Modify the memory leak 11/65111/3 accepted/tizen/common/20160411.130043 accepted/tizen/ivi/20160411.095703 accepted/tizen/mobile/20160411.095636 accepted/tizen/tv/20160411.095641 accepted/tizen/wearable/20160411.095604 submit/tizen/20160411.030344
authorHyuk Lee <hyuk0512.lee@samsung.com>
Thu, 7 Apr 2016 08:54:00 +0000 (17:54 +0900)
committerHyuk Lee <hyuk0512.lee@samsung.com>
Mon, 11 Apr 2016 00:26:54 +0000 (09:26 +0900)
Change-Id: Ia470cfab1742c655d7fadb273c42f41e5e89b77b
Signed-off-by: Hyuk Lee <hyuk0512.lee@samsung.com>
ag-agent/bluetooth-ag-agent.c

index 0ee7885..4696ed0 100755 (executable)
@@ -3010,11 +3010,7 @@ static void __bt_ag_agent_method(GDBusConnection *connection,
                if (ret)
                        goto fail;
 
-               if (local_addr)
-                       g_free(local_addr);
-
-               local_addr = g_strdup(address);
-               DBG("Address = %s\n", local_addr);
+               DBG("Address = %s\n", address);
                g_dbus_method_invocation_return_value(invocation, NULL);
        } else if (g_strcmp0(method_name, "UnregisterApplication") == 0) {
                gchar *path = NULL;
@@ -3978,13 +3974,15 @@ static void __bt_ag_agent_filter_cb(GDBusConnection *connection,
 {
        FN_START;
        char *path = NULL;
-       GVariant *optional_param;
+       GVariant *optional_param = NULL;
 
        if (strcasecmp(signal_name, "InterfacesAdded") == 0) {
 
                g_variant_get(parameters, "(&o@a{sa{sv}})",
                                                        &path, &optional_param);
                if (!path) {
+                       if (optional_param)
+                               g_variant_unref(optional_param);
                        ERR("Invalid adapter path");
                        return;
                }
@@ -4002,6 +4000,8 @@ static void __bt_ag_agent_filter_cb(GDBusConnection *connection,
        } else if (strcasecmp(signal_name, "InterfacesRemoved") == 0) {
                g_variant_get(parameters, "(&o@as)", &path, &optional_param);
                if (!path) {
+                       if (optional_param)
+                               g_variant_unref(optional_param);
                        ERR("Invalid adapter path");
                        return;
                }
@@ -4016,6 +4016,9 @@ static void __bt_ag_agent_filter_cb(GDBusConnection *connection,
                }
        }
 
+       if (optional_param)
+               g_variant_unref(optional_param);
+
        FN_END;
 }
 
@@ -4230,6 +4233,12 @@ static void __bt_ag_agent_media_filter_cb(GDBusConnection *connection,
                }
        }
 
+       if (dict_param)
+               g_variant_unref(dict_param);
+
+       if (optional_param)
+               g_variant_unref(optional_param);
+
        FN_END;
 }
 #endif