mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-25 10:50:08 +03:00
parser: Fix memory leak after malloc failure in xml*ParseDTD
This commit is contained in:
parent
69f12d6d47
commit
fee0006a06
2
parser.c
2
parser.c
@ -11819,6 +11819,7 @@ xmlIOParseDTD(xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input,
|
||||
* plug some encoding conversion routines here.
|
||||
*/
|
||||
if (xmlPushInput(ctxt, pinput) < 0) {
|
||||
xmlFreeInputStream(pinput);
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
return(NULL);
|
||||
}
|
||||
@ -11920,6 +11921,7 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const xmlChar *ExternalID,
|
||||
* plug some encoding conversion routines here.
|
||||
*/
|
||||
if (xmlPushInput(ctxt, input) < 0) {
|
||||
xmlFreeInputStream(input);
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
if (systemIdCanonic != NULL)
|
||||
xmlFree(systemIdCanonic);
|
||||
|
Loading…
x
Reference in New Issue
Block a user