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-15 12:17:17 +0900
commit0f36401de807e369566cd0344399c9b46b738fed (patch)
tree753a057743b93a982fa3775689c2027c631d5be9
parente1a2332132957a7735a6aaf0f79c002d5c81618e (diff)
downloadconnman-accepted/tizen_unified.tar.gz
connman-accepted/tizen_unified.tar.bz2
connman-accepted/tizen_unified.zip
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 1852c45f..8c5cebf4 100755
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -6663,16 +6663,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 */
@@ -6718,6 +6712,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;
}
}