Fix the prevent issue 17/196617/2
authorDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 3 Jan 2019 04:14:20 +0000 (13:14 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 3 Jan 2019 04:26:56 +0000 (13:26 +0900)
Change-Id: Ibee8b47bfacd61f6704915a881da0fc459b99a1b
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-api/bt-common.c
bt-service/bt-service-audio.c

index 4c7462b..75ae33c 100644 (file)
@@ -1922,12 +1922,17 @@ GVariant *_bt_get_managed_objects(void)
                        BT_MANAGER_INTERFACE,
                        NULL, &error);
 
-       if (manager_proxy == NULL && error) {
+       if (error) {
                BT_ERR("Unable to create proxy: %s", error->message);
                g_clear_error(&error);
+               if (manager_proxy)
+                       g_object_unref(manager_proxy);
                return NULL;
        }
 
+       if (!manager_proxy)
+               return NULL;
+
        result = g_dbus_proxy_call_sync(manager_proxy,
                        "GetManagedObjects", NULL,
                        G_DBUS_CALL_FLAGS_NONE, -1,
index 24c8c5c..171b96f 100644 (file)
@@ -167,8 +167,8 @@ static void __bt_audio_request_cb(GDBusProxy *proxy, GAsyncResult *res,
        reply = g_dbus_proxy_call_finish(proxy, res, &g_error);
        g_object_unref(proxy);
 
-    if (reply)
-        g_variant_unref(reply);
+       if (reply)
+               g_variant_unref(reply);
 
        func_data = user_data;