1From ecba4cbd4335b31aa7a815701971ed09cfffea9b Mon Sep 17 00:00:00 2001 2From: Nick Wellnhofer <wellnhofer@aevum.de> 3Date: Tue, 28 Jun 2022 19:22:31 +0200 4Subject: [PATCH] Avoid double-free if malloc fails in inputPush 5 6It's the caller's responsibility to free the input stream if this 7function fails. 8 9Reference:https://github.com/GNOME/libxml2/commit/ecba4cbd4335b31aa7a815701971ed09cfffea9b 10Conflict:NA 11 12--- 13 parser.c | 2 -- 14 1 file changed, 2 deletions(-) 15 16diff --git a/parser.c b/parser.c 17index 0d5bcc1..d8225bd 100644 18--- a/parser.c 19+++ b/parser.c 20@@ -1763,9 +1763,7 @@ inputPush(xmlParserCtxtPtr ctxt, xmlParserInputPtr value) 21 sizeof(ctxt->inputTab[0])); 22 if (ctxt->inputTab == NULL) { 23 xmlErrMemory(ctxt, NULL); 24- xmlFreeInputStream(value); 25 ctxt->inputMax /= 2; 26- value = NULL; 27 return (-1); 28 } 29 } 30-- 312.27.0 32 33