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

Avoid double-free if malloc fails in inputPush

It's the caller's responsibility to free the input stream if this
function fails.
This commit is contained in:
Nick Wellnhofer
2022-06-28 19:22:31 +02:00
parent 3e7b4f37aa
commit ecba4cbd43

View File

@@ -1752,9 +1752,7 @@ inputPush(xmlParserCtxtPtr ctxt, xmlParserInputPtr value)
sizeof(ctxt->inputTab[0]));
if (ctxt->inputTab == NULL) {
xmlErrMemory(ctxt, NULL);
xmlFreeInputStream(value);
ctxt->inputMax /= 2;
value = NULL;
return (-1);
}
}