Fix crash issue 37/184337/1 submit/tizen_4.0/20180717.214254
authorchleun.moon <chleun.moon@samsung.com>
Tue, 17 Jul 2018 04:31:50 +0000 (13:31 +0900)
committerchleun.moon <chleun.moon@samsung.com>
Tue, 17 Jul 2018 08:48:56 +0000 (17:48 +0900)
Change-Id: Ib8773610bba19581777f8d327de1c72ba1f7d216
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
packaging/capi-network-wifi-manager.spec
src/wifi_internal.c

index c30ed0c3611b32de57102be0d018f49f1f25a59c..e6466ddcd0fb84a2f62839f4e52200e7aeec1aa3 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          capi-network-wifi-manager
 Summary:       Network Wi-Fi library in TIZEN C API
-Version:       1.0.29
+Version:       1.0.30
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
index 7a0dedf613d24fad0ad7eace5a35cd9d8ad21503..c12855f9dd1134c5b2447bf910818c7bc2f9375c 100755 (executable)
@@ -1349,6 +1349,31 @@ int _wifi_get_callback_count_from_handle_list(wifi_manager_handle_cb_e e)
        return count;
 }
 
+void config_free(gpointer data)
+{
+       wifi_config_s *h = (wifi_config_s *)data;
+       g_free(h->name);
+       g_free(h->passphrase);
+       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);
+       }
+}
+
+void __clear_config_list(GSList **iterator)
+{
+       if (*iterator) {
+               g_slist_free_full(*iterator, config_free);
+               *iterator = NULL;
+       }
+}
+
 bool _wifi_deinit(void)
 {
        int rv = net_deregister_client_ext();
@@ -1365,8 +1390,7 @@ bool _wifi_deinit(void)
        g_slist_free_full(config_handle_list, g_free);
        config_handle_list = NULL;
 
-       g_slist_free_full(config_iterator, g_free);
-       config_iterator = NULL;
+       __clear_config_list(&config_iterator);
 
        return true;
 }
@@ -2572,7 +2596,7 @@ int _wifi_load_configurations(void)
        int rv;
        GSList *config_ids = NULL;
 
-       __clear_profile_list(&config_iterator);
+       __clear_config_list(&config_iterator);
 
        rv = _wifi_config_get_config_id_list(&config_ids);
        if (rv != WIFI_MANAGER_ERROR_NONE) {