From 76d52c2df38ce6bf7c2093df097e97b6f6690946 Mon Sep 17 00:00:00 2001 From: Ben Chan Date: Tue, 7 Jan 2014 23:55:45 -0800 Subject: [PATCH] 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). --- plugins/huawei/mm-broadband-bearer-huawei.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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);