1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

malloc-fail: Fix memory leak in htmlCreatePushParserCtxt

Found with libFuzzer, see #344.
This commit is contained in:
Nick Wellnhofer
2023-02-16 14:49:06 +01:00
parent fc256953d2
commit f3e62035d8

View File

@ -6346,7 +6346,7 @@ htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, void *user_data,
inputStream = htmlNewInputStream(ctxt); inputStream = htmlNewInputStream(ctxt);
if (inputStream == NULL) { if (inputStream == NULL) {
xmlFreeParserCtxt(ctxt); xmlFreeParserCtxt(ctxt);
xmlFree(buf); xmlFreeParserInputBuffer(buf);
return(NULL); return(NULL);
} }