Fix memory leak 94/311094/1 accepted/tizen/7.0/unified/20240514.162727
authorWootak Jung <wootak.jung@samsung.com>
Tue, 14 May 2024 03:01:07 +0000 (12:01 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Tue, 14 May 2024 03:24:39 +0000 (12:24 +0900)
Remove unnecessary log

Change-Id: I417d7c9eee998f81859eef255f12ed806cca8a7b
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
hf-agent/bluetooth-hf-agent.c

index a2fae12..7c41013 100644 (file)
@@ -3643,15 +3643,14 @@ static void __bt_hf_agent_filter_cb(GDBusConnection *connection,
                                                 GVariant *parameters,
                                                 gpointer user_data)
 {
-       DBG("+");
        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 (optional_param)
+                       g_variant_unref(optional_param);
 
-               g_variant_get(parameters, "(&o@a{sa{sv}})",
-                               &path, &optional_param);
                if (!path) {
                        ERR("Invalid adapter path");
                        return;
@@ -3666,8 +3665,10 @@ static void __bt_hf_agent_filter_cb(GDBusConnection *connection,
                g_variant_get(parameters, "(&o@as)", &path, &optional_param);
                if (!path)
                        __bt_hf_agent_unregister();
+
+               if (optional_param)
+                       g_variant_unref(optional_param);
        }
-       DBG("-");
 }
 
 static int __bt_hf_agent_get_adapter_path(GDBusConnection *conn, char *path)