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:
2
parser.c
2
parser.c
@@ -1752,9 +1752,7 @@ inputPush(xmlParserCtxtPtr ctxt, xmlParserInputPtr value)
|
|||||||
sizeof(ctxt->inputTab[0]));
|
sizeof(ctxt->inputTab[0]));
|
||||||
if (ctxt->inputTab == NULL) {
|
if (ctxt->inputTab == NULL) {
|
||||||
xmlErrMemory(ctxt, NULL);
|
xmlErrMemory(ctxt, NULL);
|
||||||
xmlFreeInputStream(value);
|
|
||||||
ctxt->inputMax /= 2;
|
ctxt->inputMax /= 2;
|
||||||
value = NULL;
|
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user