From: Jiwan Kim Date: Wed, 8 Feb 2017 05:56:00 +0000 (+0900) Subject: Fix crash with g_variant_unref X-Git-Tag: submit/tizen/20170512.045637~47 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9998f39ca5731a73b7a2a88a55c24acb959cce2f;p=platform%2Fcore%2Fapi%2Fzigbee.git Fix crash with g_variant_unref - With 'enable' method, g_dbus_proxy_call_sync() returns GVariant and g_variant_get() deconstructs that GVariant instance. - It causes below error and sometimes crashes. [g_variant_unref: assertion 'value != NULL' failed] - Testing with another method, issue was not found with g_variant_unref() - Patch newly uploaded due to merge conflict. (Previous patch : http://165.213.149.170/gerrit/#/c/151298/) Change-Id: I4c8b7aadcd96a6e5b86f6136e85a1e7ed48588ae Signed-off-by: Jiwan Kim --- diff --git a/lib/zbl-dbus.c b/lib/zbl-dbus.c index d76a776..9cc26f2 100644 --- a/lib/zbl-dbus.c +++ b/lib/zbl-dbus.c @@ -2926,7 +2926,8 @@ int zbl_enable(zigbee_h handle, zb_event_cb event_handler) g_variant_get(variant, "(ib)", &result, &enabled); DBG("ret = [0x%x]", result); - g_variant_unref(variant); + if(variant) + g_variant_unref(variant); return result; }