WGID-9093: Fixed memory leak 05/114405/2 accepted/tizen/3.0/common/20170215.121003 accepted/tizen/3.0/ivi/20170215.065112 accepted/tizen/3.0/mobile/20170215.065012 accepted/tizen/3.0/tv/20170215.065032 accepted/tizen/3.0/wearable/20170215.065056 submit/tizen_3.0/20170213.102726
authorSeonah Moon <seonah1.moon@samsung.com>
Mon, 13 Feb 2017 08:28:47 +0000 (17:28 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Mon, 13 Feb 2017 08:29:46 +0000 (17:29 +0900)
Change-Id: I2bc4eea631037be347a5ed687c735f7168740822
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
packaging/capi-network-wifi.spec
src/net_wifi_config.c

index ce96d371bf321e73e4de3a2f4adde7a3775755a6..511d730322700ae12eafb52a720f4c3105fa51fb 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          capi-network-wifi
 Summary:       Network Wi-Fi library in TIZEN C API
-Version:       1.0.85
+Version:       1.0.86
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
index 20c80c4347518b16b8132dc31fb680642d6ab6d8..c762e1b07f6a9946468e1281414cd82e588e6b27 100755 (executable)
@@ -277,7 +277,7 @@ EXPORT_API int wifi_config_foreach_configuration(wifi_config_list_cb callback, v
        }
 
        while (config_ids) {
-               bool rv = 0;
+               bool rv = 1;
                struct _wifi_config *h;
                gchar *id = config_ids->data;
 
@@ -291,6 +291,7 @@ EXPORT_API int wifi_config_foreach_configuration(wifi_config_list_cb callback, v
                        h->eap_config = g_new0(struct _wifi_eap_config, 1);
                        if (h->eap_config == NULL) {
                                ret = WIFI_ERROR_OUT_OF_MEMORY;
+                               g_free(h);
                                break;
                        }
                        ret = wifi_load_eap_configurations(dbus_h, id, &h->name,
@@ -306,23 +307,24 @@ EXPORT_API int wifi_config_foreach_configuration(wifi_config_list_cb callback, v
                        h->address_family = WIFI_ADDRESS_FAMILY_IPV4;
                        h->is_saved = TRUE;
                        rv = callback((wifi_config_h)h, user_data);
-                       g_free(h->name);
-                       g_free(h->proxy_address);
-                       if (h->eap_config) {
-                               g_free(h->eap_config->ca_cert);
-                               g_free(h->eap_config->client_cert);
-                               g_free(h->eap_config->private_key);
-                               g_free(h->eap_config->anonymous_identity);
-                               g_free(h->eap_config->identity);
-                               g_free(h->eap_config->subject_match);
-                               g_free(h->eap_config);
-                       }
-                       g_free(h);
-                       h = NULL;
+               }
 
-                       if (rv == false)
-                               break;
+               g_free(h->name);
+               g_free(h->proxy_address);
+               if (h->eap_config) {
+                       g_free(h->eap_config->ca_cert);
+                       g_free(h->eap_config->client_cert);
+                       g_free(h->eap_config->private_key);
+                       g_free(h->eap_config->anonymous_identity);
+                       g_free(h->eap_config->identity);
+                       g_free(h->eap_config->subject_match);
+                       g_free(h->eap_config);
                }
+               g_free(h);
+               h = NULL;
+
+               if (rv == false)
+                       break;
 
                config_ids = config_ids->next;
        }