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:
1
parser.c
1
parser.c
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user