[libxml2] Fix memory leak in libxml_saveNodeTo



commit d68c163723c74cc571cf368f8034dc4117926dfc
Author: David King <amigadave amigadave com>
Date:   Wed Jul 14 15:23:11 2021 +0100

    Fix memory leak in libxml_saveNodeTo
    
    Found by Coverity.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1938806

 python/libxml.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/python/libxml.c b/python/libxml.c
index 3b66bd61..9196b620 100644
--- a/python/libxml.c
+++ b/python/libxml.c
@@ -3053,6 +3053,7 @@ libxml_saveNodeTo(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
     if (encoding != NULL) {
         handler = xmlFindCharEncodingHandler(encoding);
         if (handler == NULL) {
+            PyFile_Release(output);
             return (PyLong_FromLong((long) -1));
         }
     }


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