Unref g_variant only when it is not NULL 76/261576/1
authorNishant Chaprana <n.chaprana@samsung.com>
Wed, 21 Jul 2021 11:02:10 +0000 (16:32 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Wed, 21 Jul 2021 11:02:10 +0000 (16:32 +0530)
Below critical warning is displayed when mobileap-agent do not send reply
for enable_wifi_tethering async dbus method call
(process:3356): GLib-CRITICAL **: g_variant_unref: assertion 'value != NULL' failed

Change-Id: I36ede863f1d602bc883bc6280e2bf64c105f9578
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
packaging/capi-network-tethering.spec
src/tethering.c

index eb7b99d528c78d027492d7d3b791a7b0368ef384..87d546f9e6406a5e3d26707f7cd3ccfaf7c9700f 100644 (file)
@@ -1,6 +1,6 @@
 Name:          capi-network-tethering
 Summary:       Tethering Framework
-Version:       1.1.6
+Version:       1.1.7
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
index 017550b0d332bfad7669f3ea303400afd9e973fb..1c334d7fa77fe7beeac9b9678c4d5d4a4d24316a 100755 (executable)
@@ -1023,6 +1023,7 @@ static void __wifi_enabled_cfm_cb(GObject *source_object, GAsyncResult *res,
                g_error_free(g_error);
        } else {
                g_variant_get(g_var, "(u)", &info);
+               g_variant_unref(g_var);
                error = __get_error(info);
        }
        retry = 0;
@@ -1042,7 +1043,6 @@ static void __wifi_enabled_cfm_cb(GObject *source_object, GAsyncResult *res,
                return;
        }
        ecb(error, type, true, data);
-       g_variant_unref(g_var);
 
        TETHERING_UNLOCK;
        INFO("-\n");