diff options
author | Jaehyun Kim <jeik01.kim@samsung.com> | 2024-10-15 12:17:17 +0900 |
---|---|---|
committer | Jaehyun Kim <jeik01.kim@samsung.com> | 2024-10-15 12:17:17 +0900 |
commit | 0f36401de807e369566cd0344399c9b46b738fed (patch) | |
tree | 753a057743b93a982fa3775689c2027c631d5be9 | |
parent | e1a2332132957a7735a6aaf0f79c002d5c81618e (diff) | |
download | connman-accepted/tizen_unified.tar.gz connman-accepted/tizen_unified.tar.bz2 connman-accepted/tizen_unified.zip |
Fix PASSED_TO_PROC_AFTER_FREE.EXHEADtizen_9.0_m2_releaseaccepted/tizen/unified/x/asan/20241022.113609accepted/tizen/unified/x/20241017.170418accepted/tizen/unified/toolchain/20241022.123118accepted/tizen/unified/toolchain/20241022.122721accepted/tizen/unified/20241017.114727accepted/tizen/9.0/unified/20241030.233541tizen_9.0tizenaccepted/tizen_unified_x_asanaccepted/tizen_unified_xaccepted/tizen_unified_toolchainaccepted/tizen_unifiedaccepted/tizen_9.0_unified
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-x | gsupplicant/supplicant.c | 16 |
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; } } |