From: DoHyun Pyun Date: Mon, 23 Oct 2017 08:35:13 +0000 (+0900) Subject: Fix TBT socket client fail issue X-Git-Tag: accepted/tizen/4.0/unified/20171023.120736^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git;a=commitdiff_plain;h=ebef700c9bf506d2030a90ae634136e07708f905 Fix TBT socket client fail issue Adjust the location to free the variable. We should free the value after using it. Change-Id: I96461efce94ce9e4bc85146239fa4781c0858f60 Signed-off-by: DoHyun Pyun --- diff --git a/bt-api/bt-common.c b/bt-api/bt-common.c index af738d5..7c2d5b9 100644 --- a/bt-api/bt-common.c +++ b/bt-api/bt-common.c @@ -1478,8 +1478,6 @@ int _bt_discover_service_uuids(char *address, char *remote_uuid) g_variant_get(ret, "(v)", &value); uuid_value = (char **)g_variant_get_strv(value, &size); BT_DBG("Size items %d", size); - g_variant_unref(value); - g_variant_unref(ret); } if (uuid_value) { @@ -1501,6 +1499,12 @@ done: if (uuid_value) g_free(uuid_value); + if (value) + g_variant_unref(value); + + if (ret) + g_variant_unref(ret); + BT_DBG("-"); return result; }