[libxml2] Fix memory leak in xmlXPathCompNodeTest



commit 67953a9f1153e7bd805916e50b4ed43f1ec0bb21
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Sun Jan 16 15:30:02 2022 +0100

    Fix memory leak in xmlXPathCompNodeTest
    
    Found by Coverity.

 xpath.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/xpath.c b/xpath.c
index 1aa2f1ab..2da591ce 100644
--- a/xpath.c
+++ b/xpath.c
@@ -11120,7 +11120,9 @@ xmlXPathCompNodeTest(xmlXPathParserContextPtr ctxt, xmlXPathTestVal *test,
            name = NULL;
            if (CUR != ')') {
                name = xmlXPathParseLiteral(ctxt);
-               CHECK_ERROR NULL;
+                if (name == NULL) {
+                   XP_ERRORNULL(XPATH_EXPR_ERROR);
+                }
                *test = NODE_TEST_PI;
                SKIP_BLANKS;
            }


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