diff --git a/components/esp_http_server/src/httpd_txrx.c b/components/esp_http_server/src/httpd_txrx.c index 1404d4f994..475eb84fea 100644 --- a/components/esp_http_server/src/httpd_txrx.c +++ b/components/esp_http_server/src/httpd_txrx.c @@ -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;