1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-10 08:58:16 +03:00

Fix memory leak in xmlLoadEntityContent error path

Free the input stream if pushing it fails.

Found by OSS-Fuzz.

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43743
This commit is contained in:
Nick Wellnhofer 2022-06-28 19:24:14 +02:00
parent ecba4cbd43
commit ca2c91f139

View File

@ -8088,6 +8088,7 @@ xmlLoadEntityContent(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) {
*/
if (xmlPushInput(ctxt, input) < 0) {
xmlBufferFree(buf);
xmlFreeInputStream(input);
return(-1);
}