Fix the memory leak
[platform/core/connectivity/bluetooth-agent.git] / ipsp-agent / bluetooth-ipsp-agent.c
index f16531c..fd2f0dc 100644 (file)
@@ -715,7 +715,7 @@ static void __bt_ipsp_dbus_method(GDBusConnection *connection,
                BT_DBG("");
                char *ifname = NULL;
                char *address = NULL;
-               char *ip6;
+               char *ip6 = NULL;
                gchar *network_ipv6_address = NULL;
 
                char *remote_ipv6_address = NULL;
@@ -734,6 +734,8 @@ static void __bt_ipsp_dbus_method(GDBusConnection *connection,
                if (ret != BT_ERROR_NONE)
                        BT_DBG("failed to set ipv6 address");
 
+               g_free(ip6);
+
                ret = __bt_ipsp_create_ipv6_remote_address(address, &remote_ipv6_address);
                if (ret != BT_ERROR_NONE)
                        BT_DBG("failed to create remote device ipv6 address");