Skip to content

Commit

Permalink
Merge branch 'bugfix/fix_iperf_example_exception_handling_for_no_ap_f…
Browse files Browse the repository at this point in the history
…ound_v4.2' into 'release/v4.2'

bugfix/fix_iperf_example_exception_handling_for_no_ap_found_v4.2

See merge request espressif/esp-idf!12268
  • Loading branch information
jack0c committed Mar 19, 2021
2 parents e305c09 + 7da388e commit eedcb8c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/wifi/iperf/main/cmd_wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,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");
Expand Down

0 comments on commit eedcb8c

Please sign in to comment.