From ecba4cbd4335b31aa7a815701971ed09cfffea9b Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Tue, 28 Jun 2022 19:22:31 +0200 Subject: [PATCH] Avoid double-free if malloc fails in inputPush It's the caller's responsibility to free the input stream if this function fails. Reference:https://github.com/GNOME/libxml2/commit/ecba4cbd4335b31aa7a815701971ed09cfffea9b Conflict:NA --- parser.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/parser.c b/parser.c index 0d5bcc1..d8225bd 100644 --- a/parser.c +++ b/parser.c @@ -1763,9 +1763,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); } } -- 2.27.0