Fix Svave issue - MEMORY_LEAK.STRDUP 27/68127/1 submit/tizen/20160503.014429
authorDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 2 May 2016 10:59:37 +0000 (19:59 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 2 May 2016 10:59:37 +0000 (19:59 +0900)
WGID: 60292

Change-Id: I68abe304dbbde1471a3709558fb2af1762f8a045
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
hf-agent/bluetooth-hf-agent.c

index 929a1b4..6662f76 100755 (executable)
@@ -570,6 +570,7 @@ static gboolean __bt_hf_register_profile_methods(void)
        conn = __bt_hf_get_gdbus_connection();
        if (!conn) {
                ERR("Unable to get connection");
+               g_free(path);
                return FALSE;
        }
 
@@ -599,8 +600,10 @@ static gboolean __bt_hf_register_profile_methods(void)
                                                &method_table,
                                                NULL, NULL, &error);
        if (object_id == 0) {
-               ERR("Failed to register: %s", error->message);
-               g_error_free(error);
+               if (error != NULL) {
+                       ERR("Failed to register: %s", error->message);
+                       g_error_free(error);
+               }
                g_dbus_node_info_unref(node_info);
                g_free(path);
                return FALSE;