Fixed memory leaks 10/71310/2 accepted/tizen/common/20160525.160154 accepted/tizen/ivi/20160525.235346 accepted/tizen/mobile/20160525.235511 accepted/tizen/tv/20160525.235328 accepted/tizen/wearable/20160525.235349 submit/tizen/20160525.071711
authorhyunuktak <hyunuk.tak@samsung.com>
Wed, 25 May 2016 04:49:22 +0000 (13:49 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Wed, 25 May 2016 06:45:30 +0000 (15:45 +0900)
LEAK SUMMARY:
definitely lost: 0 bytes in 0 blocks
indirectly lost: 0 bytes in 0 blocks
possibly lost: 8,780 bytes in 285 blocks
still reachable: 93,570 bytes in 1,750 blocks
suppressed: 0 bytes in 0 blocks

Change-Id: Ieb6fd5ec2909f2ea71207dfd80714cd677203540
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
packaging/net-config.spec
src/network-state.c [changed mode: 0644->0755]
src/signal-handler.c
src/utils/util.c [changed mode: 0644->0755]
src/wifi-agent.c
src/wifi-state.c

index 36965c8..69f083e 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          net-config
 Summary:       TIZEN Network Configuration service
-Version:       1.1.69
+Version:       1.1.70
 Release:       2
 Group:         System/Network
 License:       Apache-2.0
old mode 100644 (file)
new mode 100755 (executable)
index cfba8d9..7df844c
@@ -196,6 +196,8 @@ static void __netconfig_get_default_connection_info(const char *profile)
                                        netconfig_default_connection_info.ifname = g_strdup(value);
                                }
                        }
+                       if (iter1)
+                               g_variant_iter_free(iter1);
                } else if (g_strcmp0(key, "IPv4") == 0) {
                        g_variant_get(next, "a{sv}", &iter1);
                        while (g_variant_iter_loop(iter1, "{sv}", &key1, &variant)) {
@@ -204,6 +206,8 @@ static void __netconfig_get_default_connection_info(const char *profile)
                                        netconfig_default_connection_info.ipaddress = g_strdup(value);
                                }
                        }
+                       if (iter1)
+                               g_variant_iter_free(iter1);
                } else if (g_strcmp0(key, "IPv6") == 0) {
                        g_variant_get(next, "a{sv}", &iter1);
                        while (g_variant_iter_loop(iter1, "{sv}", &key1, &variant)) {
@@ -212,6 +216,8 @@ static void __netconfig_get_default_connection_info(const char *profile)
                                        netconfig_default_connection_info.ipaddress6 = g_strdup(value);
                                }
                        }
+                       if (iter1)
+                               g_variant_iter_free(iter1);
                } else if (g_strcmp0(key, "Proxy") == 0) {
                        g_variant_get(next, "a{sv}", &iter1);
                        while (g_variant_iter_loop(iter1, "{sv}", &key2, &variant2)) {
@@ -247,6 +253,8 @@ static void __netconfig_get_default_connection_info(const char *profile)
                                        }
                                }
                        }
+                       if (iter1)
+                               g_variant_iter_free(iter1);
                } else if (g_strcmp0(key, "Frequency") == 0) {
                        if (g_variant_is_of_type(next, G_VARIANT_TYPE_UINT16)) {
                                freq = g_variant_get_uint16(next);
index 94703ce..02bdde8 100755 (executable)
@@ -162,12 +162,16 @@ static void _service_signal_cb(GDBusConnection *conn,
                        int wifi_state = 0;
 
                        vconf_get_int(VCONFKEY_WIFI_STATE, &wifi_state);
-                       if (wifi_state == VCONFKEY_WIFI_OFF)
+                       if (wifi_state == VCONFKEY_WIFI_OFF) {
+                               g_free(property);
                                goto done;
+                       }
 
                        if (g_strcmp0(property, "ready") == 0 || g_strcmp0(property, "online") == 0) {
-                               if (wifi_state >= VCONFKEY_WIFI_CONNECTED)
+                               if (wifi_state >= VCONFKEY_WIFI_CONNECTED) {
+                                       g_free(property);
                                        goto done;
+                               }
 
                                netconfig_update_default_profile(path);
 
@@ -181,11 +185,14 @@ static void _service_signal_cb(GDBusConnection *conn,
                                                wifi_state_set_service_state(NETCONFIG_WIFI_FAILURE);
                                        else
                                                wifi_state_set_service_state(NETCONFIG_WIFI_IDLE);
+                                       g_free(property);
                                        goto done;
                                }
 
-                               if (g_strcmp0(path, netconfig_get_default_profile()) != 0)
+                               if (g_strcmp0(path, netconfig_get_default_profile()) != 0) {
+                                       g_free(property);
                                        goto done;
+                               }
 
                                netconfig_update_default_profile(NULL);
 
@@ -201,11 +208,14 @@ static void _service_signal_cb(GDBusConnection *conn,
                                                wifi_state_set_service_state(NETCONFIG_WIFI_ASSOCIATION);
                                        else
                                                wifi_state_set_service_state(NETCONFIG_WIFI_CONFIGURATION);
+                                       g_free(property);
                                        goto done;
                                }
 
-                               if (g_strcmp0(path, netconfig_get_default_profile()) != 0)
+                               if (g_strcmp0(path, netconfig_get_default_profile()) != 0) {
+                                       g_free(property);
                                        goto done;
+                               }
 
                                netconfig_update_default_profile(NULL);
 
@@ -230,29 +240,38 @@ static void _service_signal_cb(GDBusConnection *conn,
                                        cellular_state_set_service_state(NETCONFIG_CELLULAR_ONLINE);
 
                        } else if (g_strcmp0(property, "failure") == 0 || g_strcmp0(property, "disconnect") == 0 || g_strcmp0(property, "idle") == 0) {
-                               if (netconfig_get_default_profile() == NULL)
+                               if (netconfig_get_default_profile() == NULL) {
+                                       g_free(property);
                                        goto done;
+                               }
 
                                if (netconfig_is_cellular_profile(path) && netconfig_is_cellular_internet_profile(path))
                                        cellular_state_set_service_state(NETCONFIG_CELLULAR_IDLE);
 
-                               if (g_strcmp0(path, netconfig_get_default_profile()) != 0)
+                               if (g_strcmp0(path, netconfig_get_default_profile()) != 0) {
+                                       g_free(property);
                                        goto done;
+                               }
 
                                netconfig_update_default_profile(NULL);
                        } else if (g_strcmp0(property, "association") == 0 || g_strcmp0(property, "configuration") == 0) {
-                               if (netconfig_get_default_profile() == NULL)
+                               if (netconfig_get_default_profile() == NULL) {
+                                       g_free(property);
                                        goto done;
+                               }
 
                                if (netconfig_is_cellular_profile(path) && netconfig_is_cellular_internet_profile(path))
                                        cellular_state_set_service_state(NETCONFIG_CELLULAR_CONNECTING);
 
-                               if (g_strcmp0(path, netconfig_get_default_profile()) != 0)
+                               if (g_strcmp0(path, netconfig_get_default_profile()) != 0) {
+                                       g_free(property);
                                        goto done;
+                               }
 
                                netconfig_update_default_profile(NULL);
                        }
                }
+               g_free(property);
        } else if (g_strcmp0(sigvalue, "Proxy") == 0) {
                if (netconfig_is_wifi_profile(path) != TRUE || g_strcmp0(path, netconfig_get_default_profile()) != 0)
                        goto done;
@@ -292,6 +311,7 @@ static void _service_signal_cb(GDBusConnection *conn,
        } else if (g_strcmp0(sigvalue, "Error") == 0) {
                g_variant_get(variant, "s", &property);
                INFO("[%s] Property : %s", sigvalue, property);
+               g_free(property);
        }
 done:
        if (sigvalue)
@@ -368,6 +388,7 @@ static void _services_changed_cb(GDBusConnection *conn, const gchar *name,
                                                        g_strcmp0(value,
                                                                "online") != 0) {
                                                g_free(property);
+                                               g_free(value);
                                                g_variant_unref(variant);
                                                break;
                                        }
@@ -387,6 +408,7 @@ static void _services_changed_cb(GDBusConnection *conn, const gchar *name,
                                                cellular_state_set_service_state(
                                                        NETCONFIG_CELLULAR_ONLINE);
                                        g_free(property);
+                                       g_free(value);
                                        g_variant_unref(variant);
                                        break;
                                }
@@ -398,6 +420,7 @@ static void _services_changed_cb(GDBusConnection *conn, const gchar *name,
 
        if (next)
                g_variant_iter_free(next);
+
        if (removed)
                g_variant_iter_free(removed);
 
old mode 100644 (file)
new mode 100755 (executable)
index 3c7c87b..9e12fff 100755 (executable)
@@ -105,6 +105,7 @@ int connman_register_agent(void)
                        if (error != NULL) {
                                if (g_strcmp0(error->message,
                                                "GDBus.Error:net.connman.Error.AlreadyExists: Already exists") == 0) {
+                                       g_error_free(error);
                                        break;
                                } else {
                                        ERR("Fail to register agent [%d: %s]",
index adf918b..3b34ca4 100755 (executable)
@@ -344,6 +344,7 @@ static void _set_power_save(gboolean power_save)
        else
                old_state = power_save;
 
+       g_variant_unref(input_args);
        return;
 }