summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Kim <jeik01.kim@samsung.com>2024-10-15 12:17:17 +0900
committerJaehyun Kim <jeik01.kim@samsung.com>2024-10-25 10:55:50 +0900
commite9ce6474bfa21cbc24e410a3085034348a7ec1f4 (patch)
treeb1b02089b2c382fda388391b07e0c206970c74c8
parent510c6883d20ced9c4fae87e88d74b01331f1e2d5 (diff)
downloadconnman-tizen_8.0.tar.gz
connman-tizen_8.0.tar.bz2
connman-tizen_8.0.zip
Fix PASSED_TO_PROC_AFTER_FREE.EXtizen_8.0
Pointer 'scan_data' and 'scan_data_local' are passed to print_scan_freqs() after the referenced memory was deallocated in set_band_freqs(). Change-Id: I683bb5ec2874716f94cc50c9a8f7b8149bd368db Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
-rwxr-xr-xgsupplicant/supplicant.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 1b680531..a1afa4b9 100755
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -6667,16 +6667,10 @@ static void set_band_freqs(GSupplicantScanParams *scan_data)
switch (wifi_band_selection_method) {
case WIFI_BAND_SELECTION_2_4GHZ:
- if (!set_band_freqs_2_4ghz(scan_data)) {
- g_free(scan_data);
- return;
- }
+ set_band_freqs_2_4ghz(scan_data);
break;
case WIFI_BAND_SELECTION_5GHZ:
- if (!set_band_freqs_5ghz(scan_data)) {
- g_free(scan_data);
- return;
- }
+ set_band_freqs_5ghz(scan_data);
break;
case WIFI_BAND_SELECTION_6GHZ:
/* Currently not supported */
@@ -6722,6 +6716,12 @@ int g_supplicant_interface_scan(GSupplicantInterface *interface,
} else {
set_band_freqs(scan_data_local);
print_scan_freqs(scan_data_local);
+
+ if (scan_data_local->num_freqs == 0) {
+ g_free(scan_data_local);
+ scan_data_local = NULL;
+ }
+
data->scan_params = scan_data_local;
}
}