Skip to content

Commit b789445

Browse files
committed
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
2 parents 02b2f69 + fd33d02 commit b789445

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

components/esp_http_server/src/httpd_txrx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,7 @@ esp_err_t httpd_req_async_handler_begin(httpd_req_t *r, httpd_req_t **out)
675675

676676
async_aux->resp_hdrs = calloc(hd->config.max_resp_headers, sizeof(struct resp_hdr));
677677
if (async_aux->resp_hdrs == NULL) {
678+
free(async_aux->scratch);
678679
free(async_aux);
679680
free(async);
680681
return ESP_ERR_NO_MEM;

0 commit comments

Comments
 (0)