Merge branch 'bugfix/fix_iperf_example_exception_handling_for_no_ap_found_v4.0' into 'release/v4.0'

bugfix/fix_iperf_example_exception_handling_for_no_ap_found_v4.0

See merge request espressif/esp-idf!12273
This commit is contained in:
Jiang Jiang Jian
2021-03-22 04:28:54 +00:00

View File

@ -61,6 +61,11 @@ static void scan_done_handler(void* arg, esp_event_base_t event_base,
wifi_ap_record_t *ap_list_buffer;
esp_wifi_scan_get_ap_num(&sta_number);
if (!sta_number) {
ESP_LOGE(TAG, "No AP found");
return;
}
ap_list_buffer = malloc(sta_number * sizeof(wifi_ap_record_t));
if (ap_list_buffer == NULL) {
ESP_LOGE(TAG, "Failed to malloc buffer to print scan results");