[PATCH] huawei: avoid calling g_object_unref on NULL
Aleksander Morgado
aleksander at aleksander.es
Wed Jan 8 01:10:14 PST 2014
On 08/01/14 08:55, Ben Chan wrote:
> 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(-)
>
Pushed, thanks!
> diff --git a/plugins/huawei/mm-broadband-bearer-huawei.c b/plugins/huawei/mm-broadband-bearer-huawei.c
> index b39839f..be84ff8 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);
>
--
Aleksander
More information about the ModemManager-devel
mailing list