Merge branch 'bugfix/fix_esp_http_client_example_v4.4' into 'release/v4.4'

esp_http_client: Fix memory leak in esp_http_client_example (backport v4.4)

See merge request espressif/esp-idf!17095
pull/8460/head
Mahavir Jain 2022-02-11 04:56:29 +00:00
commit 47583770a1
1 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -100,14 +100,14 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt)
int mbedtls_err = 0;
esp_err_t err = esp_tls_get_and_clear_last_error(evt->data, &mbedtls_err, NULL);
if (err != 0) {
if (output_buffer != NULL) {
free(output_buffer);
output_buffer = NULL;
}
output_len = 0;
ESP_LOGI(TAG, "Last esp error code: 0x%x", err);
ESP_LOGI(TAG, "Last mbedtls failure: 0x%x", mbedtls_err);
}
if (output_buffer != NULL) {
free(output_buffer);
output_buffer = NULL;
}
output_len = 0;
break;
}
return ESP_OK;