xmllint: Fix UAF with --push --repeat

Short-lived regression. Fixes #841.
This commit is contained in:
Nick Wellnhofer 2025-01-22 09:38:43 +01:00
parent 9d7bbf1952
commit dc6270d110

View File

@ -349,6 +349,7 @@ parseXml(xmllintState *lint, const char *filename) {
xmlParseChunk(ctxt, chars, 0, 1);
doc = ctxt->myDoc;
ctxt->myDoc = NULL;
if (f != stdin)
fclose(f);
return(doc);
@ -427,6 +428,7 @@ parseHtml(xmllintState *lint, const char *filename) {
}
htmlParseChunk(ctxt, chars, 0, 1);
doc = ctxt->myDoc;
ctxt->myDoc = NULL;
if (f != stdin)
fclose(f);