From: Jaehyun Kim Date: Fri, 28 Aug 2020 11:15:50 +0000 (+0900) Subject: Fix resource leak and double free X-Git-Tag: submit/tizen/20200828.142119~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6a55d28507b6da25a962ff6fa57b4ceee2c658a0;p=platform%2Fcore%2Fconnectivity%2Fnet-config.git Fix resource leak and double free Change-Id: I1dd7fe019e60c9bf552e7cce52b3b4deaa04f116 Signed-off-by: Jaehyun Kim --- diff --git a/src/wifi-bssid-scan.c b/src/wifi-bssid-scan.c index a7597c0..4846c3b 100755 --- a/src/wifi-bssid-scan.c +++ b/src/wifi-bssid-scan.c @@ -121,13 +121,8 @@ static void __append_bssid_scan_info(const char *interface_name, bssid_scan_data_s *scan_data; scan_data = __get_bssid_scan_data(interface_name); - if (scan_data == NULL) { - scan_data = g_try_new0(bssid_scan_data_s, 1); - if (scan_data == NULL) - return; - - scan_data->interface_name = g_strdup(interface_name); - } + if (scan_data == NULL) + return; scan_data->scan_info_list = g_slist_append(scan_data->scan_info_list, scan_info); } diff --git a/src/wifi-eap-config.c b/src/wifi-eap-config.c index 3abd475..0869219 100755 --- a/src/wifi-eap-config.c +++ b/src/wifi-eap-config.c @@ -465,7 +465,7 @@ static void __netconfig_eap_state(wifi_state_notifier_s *notifier, wifi_state_notifier_unregister(notifier); g_free(notifier->service); g_free(notifier->user_data); - g_free(notifier->service); + g_free(notifier); } gboolean handle_create_eap_config(Wifi *wifi, GDBusMethodInvocation *context,