[libxml2] Avoid double-free if malloc fails in inputPush



commit ecba4cbd4335b31aa7a815701971ed09cfffea9b
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Tue Jun 28 19:22:31 2022 +0200

    Avoid double-free if malloc fails in inputPush
    
    It's the caller's responsibility to free the input stream if this
    function fails.

 parser.c | 2 --
 1 file changed, 2 deletions(-)
---
diff --git a/parser.c b/parser.c
index 280a815d..0464a302 100644
--- a/parser.c
+++ b/parser.c
@@ -1752,9 +1752,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);
         }
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]