Fix memory leak in xmlNewInputFromFile

Found by Coverity.

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

View File

@ -1546,8 +1546,10 @@ xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename) {
}
inputStream = xmlNewInputStream(ctxt);
if (inputStream == NULL)
if (inputStream == NULL) {
xmlFreeParserInputBuffer(buf);
return(NULL);
}
inputStream->buf = buf;
inputStream = xmlCheckHTTPInput(ctxt, inputStream);