Merge branch 'contrib/github_pr_17501' into 'master'

fix(esp_http_server): fix memory leak in httpd_req_async_handler_begin (GitHub PR)

Closes IDFGH-16361

See merge request espressif/esp-idf!41748
This commit is contained in:
Mahavir Jain
2025-09-10 13:15:36 +05:30

View File

@@ -675,6 +675,7 @@ esp_err_t httpd_req_async_handler_begin(httpd_req_t *r, httpd_req_t **out)
async_aux->resp_hdrs = calloc(hd->config.max_resp_headers, sizeof(struct resp_hdr));
if (async_aux->resp_hdrs == NULL) {
free(async_aux->scratch);
free(async_aux);
free(async);
return ESP_ERR_NO_MEM;