Skip to content
Snippets Groups Projects
Commit 22f130ca authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix resource leak in ssjs_send_headers()

IdArray returned by JS_Enumerate() was never freed.

Caught by Coverity-scan, CID 319627.
parent 7505f317
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #1817 passed
......@@ -5805,6 +5805,7 @@ static BOOL ssjs_send_headers(http_session_t* session,int chunked)
if(p==NULL) {
if(p2)
free(p2);
JS_DestroyIdArray(session->js_cx, heads);
return FALSE;
}
if(JS_GetProperty(session->js_cx,headers,p,&val))
......@@ -5814,6 +5815,7 @@ static BOOL ssjs_send_headers(http_session_t* session,int chunked)
free(p);
if(p2)
free(p2);
JS_DestroyIdArray(session->js_cx, heads);
return FALSE;
}
if (p2 != NULL && !session->req.sent_headers) {
......@@ -5853,6 +5855,7 @@ static BOOL ssjs_send_headers(http_session_t* session,int chunked)
if(p2)
free(p2);
JS_ClearScope(session->js_cx, headers);
JS_DestroyIdArray(session->js_cx, heads);
}
JS_ENDREQUEST(session->js_cx);
return(send_headers(session,session->req.status,chunked));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment