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

Fix memory leak in xmlCreateIOParserCtxt

Found by Coverity.

https://bugzilla.redhat.com/show_bug.cgi?id=1938806
This commit is contained in:
David King
2021-07-14 14:35:17 +01:00
committed by Nick Wellnhofer
parent f0904f3266
commit fe564967c9

View File

@@ -12625,6 +12625,7 @@ xmlCreateIOParserCtxt(xmlSAXHandlerPtr sax, void *user_data,
xmlFree(ctxt->sax); xmlFree(ctxt->sax);
ctxt->sax = (xmlSAXHandlerPtr) xmlMalloc(sizeof(xmlSAXHandler)); ctxt->sax = (xmlSAXHandlerPtr) xmlMalloc(sizeof(xmlSAXHandler));
if (ctxt->sax == NULL) { if (ctxt->sax == NULL) {
xmlFreeParserInputBuffer(buf);
xmlErrMemory(ctxt, NULL); xmlErrMemory(ctxt, NULL);
xmlFreeParserCtxt(ctxt); xmlFreeParserCtxt(ctxt);
return(NULL); return(NULL);