Fix TBT socket client fail issue 75/157075/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 23 Oct 2017 08:35:13 +0000 (17:35 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 23 Oct 2017 08:37:13 +0000 (17:37 +0900)
Adjust the location to free the variable. We should free the value
after using it.

Change-Id: I7a7ccfb79023dbff16734b1098dbe478df8e6090
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-api/bt-common.c

index af738d5..7c2d5b9 100644 (file)
@@ -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;
 }