From: chleun.moon Date: Tue, 17 Jul 2018 04:31:50 +0000 (+0900) Subject: Fix crash issue X-Git-Tag: submit/tizen/20180717.214119^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f77fdf43d1b58cb6462529f683a4964646afae83;p=platform%2Fcore%2Fapi%2Fwifi-manager.git Fix crash issue Change-Id: Ia9035c8f4e36e5d6996917f87e0d5d08adc09907 Signed-off-by: Cheoleun Moon --- diff --git a/packaging/capi-network-wifi-manager.spec b/packaging/capi-network-wifi-manager.spec index d802ad2..c115057 100755 --- a/packaging/capi-network-wifi-manager.spec +++ b/packaging/capi-network-wifi-manager.spec @@ -1,6 +1,6 @@ Name: capi-network-wifi-manager Summary: Network Wi-Fi library in TIZEN C API -Version: 1.0.38 +Version: 1.0.39 Release: 1 Group: System/Network License: Apache-2.0 diff --git a/src/wifi_internal.c b/src/wifi_internal.c index 72bf7a9..deebdb3 100755 --- a/src/wifi_internal.c +++ b/src/wifi_internal.c @@ -1517,6 +1517,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(); @@ -1533,8 +1558,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; } @@ -2803,7 +2827,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) {