[libxml2] Fix memory leak in xmlSAX2StartElement



commit 6b49db2cb235a54b6a3bd91dccf3d98b9cdeaa65
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Mon Jan 7 17:14:21 2019 +0100

    Fix memory leak in xmlSAX2StartElement
    
    Introduced by a recent commit. Only happens if max depth is exceeded
    in SAX1 mode.
    
    Found by OSS-Fuzz.

 SAX2.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/SAX2.c b/SAX2.c
index 7642501a..fee66b7f 100644
--- a/SAX2.c
+++ b/SAX2.c
@@ -1668,6 +1668,8 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
     if (nodePush(ctxt, ret) < 0) {
         xmlUnlinkNode(ret);
         xmlFreeNode(ret);
+        if (prefix != NULL)
+            xmlFree(prefix);
         return;
     }
 


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