esp_http_server: fix wrong context pointer in httpd_req_cleanup function

Added example which fails without the fix

Closes https://github.com/espressif/esp-idf/issues/10265
This commit is contained in:
Harshit Malpani
2022-11-29 16:56:22 +05:30
parent 56efeb2c76
commit 3353d8404a

View File

@@ -694,7 +694,7 @@ static void httpd_req_cleanup(httpd_req_t *r)
/* Check if the context has changed and needs to be cleared */
if ((r->ignore_sess_ctx_changes == false) && (ra->sd->ctx != r->sess_ctx)) {
httpd_sess_free_ctx(ra->sd->ctx, ra->sd->free_ctx);
httpd_sess_free_ctx(&ra->sd->ctx, ra->sd->free_ctx);
}
#if CONFIG_HTTPD_WS_SUPPORT