Fix resource leak and double free 45/242645/1
authorJaehyun Kim <jeik01.kim@samsung.com>
Fri, 28 Aug 2020 11:15:50 +0000 (20:15 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Fri, 28 Aug 2020 11:15:50 +0000 (20:15 +0900)
Change-Id: I1dd7fe019e60c9bf552e7cce52b3b4deaa04f116
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
src/wifi-bssid-scan.c
src/wifi-eap-config.c

index a7597c0..4846c3b 100755 (executable)
@@ -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);
 }
index 3abd475..0869219 100755 (executable)
@@ -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,