1From ca2c91f139426f63646292da58a15a1511dccc0f Mon Sep 17 00:00:00 2001 2From: Nick Wellnhofer <wellnhofer@aevum.de> 3Date: Tue, 28 Jun 2022 19:24:14 +0200 4Subject: [PATCH] Fix memory leak in xmlLoadEntityContent error path 5 6Free the input stream if pushing it fails. 7 8Found by OSS-Fuzz. 9 10https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43743 11 12Reference:https://github.com/GNOME/libxml2/commit/ca2c91f139426f63646292da58a15a1511dccc0f 13Conflict:NA 14 15--- 16 parser.c | 1 + 17 1 file changed, 1 insertion(+) 18 19diff --git a/parser.c b/parser.c 20index d8225bd..dd507c0 100644 21--- a/parser.c 22+++ b/parser.c 23@@ -8102,6 +8102,7 @@ xmlLoadEntityContent(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) { 24 */ 25 if (xmlPushInput(ctxt, input) < 0) { 26 xmlBufferFree(buf); 27+ xmlFreeInputStream(input); 28 return(-1); 29 } 30 31-- 322.27.0 33 34