aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Chan <benchan@chromium.org>2014-01-07 23:55:45 -0800
committerAleksander Morgado <aleksander@aleksander.es>2014-01-08 10:09:06 +0100
commit76d52c2df38ce6bf7c2093df097e97b6f6690946 (patch)
tree8d51cb52a5fbc32ba0ff85746090a858502e7ee6
parent84bdcb04ed076a8c32a6e7146922e8bdded930c2 (diff)
huawei: avoid calling g_object_unref on NULL
This patch prevents connect_3gpp_context_complete_and_free from calling 'g_object_unref (ctx->data)' when connect_3gpp finds no data port (i.e. ctx->data is set to NULL).
-rw-r--r--plugins/huawei/mm-broadband-bearer-huawei.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/huawei/mm-broadband-bearer-huawei.c b/plugins/huawei/mm-broadband-bearer-huawei.c
index b39839f8..be84ff8d 100644
--- a/plugins/huawei/mm-broadband-bearer-huawei.c
+++ b/plugins/huawei/mm-broadband-bearer-huawei.c
@@ -69,7 +69,8 @@ connect_3gpp_context_complete_and_free (Connect3gppContext *ctx)
g_simple_async_result_complete_in_idle (ctx->result);
g_object_unref (ctx->cancellable);
g_object_unref (ctx->result);
- g_object_unref (ctx->data);
+ if (ctx->data)
+ g_object_unref (ctx->data);
g_object_unref (ctx->primary);
g_object_unref (ctx->modem);
g_object_unref (ctx->self);