1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-24 13:33:01 +03:00

malloc-fail: Fix memory leak in xmlCreatePushParserCtxt

Found with libFuzzer, see #344.
This commit is contained in:
Nick Wellnhofer
2022-11-02 15:46:11 +01:00
parent a22bd982bf
commit 865e142c41

View File

@@ -12577,6 +12577,7 @@ xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, void *user_data,
inputStream->filename = (char *) inputStream->filename = (char *)
xmlCanonicPath((const xmlChar *) filename); xmlCanonicPath((const xmlChar *) filename);
if (inputStream->filename == NULL) { if (inputStream->filename == NULL) {
xmlFreeInputStream(inputStream);
xmlFreeParserCtxt(ctxt); xmlFreeParserCtxt(ctxt);
xmlFreeParserInputBuffer(buf); xmlFreeParserInputBuffer(buf);
return(NULL); return(NULL);