From 9c47c54f067f15afea7ff1e9c89d1ab41fe3e4bb Mon Sep 17 00:00:00 2001 From: Daniele Palmas Date: Wed, 29 Sep 2021 16:13:45 +0200 Subject: telit: fix g_object_unref failed assertion Fix the following g_object_unref failed assertion: ModemManager[385967]: [1632924639.132023] [modem0/ttyUSB2/at] --> 'AT+CSIM=1' ModemManager[385967]: [1632924639.144892] [modem0/ttyUSB2/at] <-- 'ERROR' ModemManager[385967]: [1632924639.145021] [modem0/ttyUSB2/at] operation failure: 100 (Unknown error) (ModemManager:385967): GLib-GObject-CRITICAL **: 16:10:39.145: g_object_unref: assertion 'G_IS_OBJECT (object)' failed --- plugins/telit/mm-broadband-modem-telit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/telit/mm-broadband-modem-telit.c b/plugins/telit/mm-broadband-modem-telit.c index 35900c9f8..bd92d0761 100644 --- a/plugins/telit/mm-broadband-modem-telit.c +++ b/plugins/telit/mm-broadband-modem-telit.c @@ -723,7 +723,8 @@ static void load_unlock_retries_step (GTask *task); static void load_unlock_retries_context_free (LoadUnlockRetriesContext *ctx) { - g_object_unref (ctx->retries); + if (ctx->retries) + g_object_unref (ctx->retries); g_slice_free (LoadUnlockRetriesContext, ctx); } -- cgit v1.2.1