fix(wifi): fix esp_wifi_scan_start memory leakage issue

Closes https://github.com/espressif/esp-idf/issues/10693
This commit is contained in:
muhaidong
2024-02-03 16:29:26 +08:00
parent 7e27152bcc
commit d278ffc501
7 changed files with 8 additions and 8 deletions

View File

@@ -812,6 +812,7 @@ static esp_err_t update_wifi_scan_results(void)
prov_ctx->ap_list[curr_channel] = (wifi_ap_record_t *) calloc(get_count, sizeof(wifi_ap_record_t));
if (!prov_ctx->ap_list[curr_channel]) {
ESP_LOGE(TAG, "Failed to allocate memory for AP list");
esp_wifi_clear_ap_list();
goto exit;
}
if (esp_wifi_scan_get_ap_records(&get_count, prov_ctx->ap_list[curr_channel]) != ESP_OK) {