client: Fix memory leak
authorSyam Sidhardhan <s.syam@samsung.com>
Tue, 3 Dec 2019 09:48:42 +0000 (15:18 +0530)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 12 Apr 2021 09:00:47 +0000 (14:30 +0530)
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
client/main.c

index 2c6a350..5add8b8 100644 (file)
@@ -1798,11 +1798,11 @@ static void remove_device(GDBusProxy *proxy)
 {
        char *path;
 
-       path = g_strdup(g_dbus_proxy_get_path(proxy));
-
        if (!default_ctrl)
                return;
 
+       path = g_strdup(g_dbus_proxy_get_path(proxy));
+
        if (g_dbus_proxy_method_call(default_ctrl->proxy, "RemoveDevice",
                                                remove_device_setup,
                                                remove_device_reply,