diff options
author | David King <amigadave@amigadave.com> | 2021-07-14 15:23:11 +0100 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2022-01-16 14:20:57 +0100 |
commit | d68c163723c74cc571cf368f8034dc4117926dfc (patch) | |
tree | d429050666df3e6cb498fef95c4b50cbe8fe4b1c | |
parent | 328456bf29b32897bcfcc13f106ec4f975ac5d8a (diff) | |
download | libxml2-d68c163723c74cc571cf368f8034dc4117926dfc.tar.gz |
Fix memory leak in libxml_saveNodeTo
Found by Coverity.
https://bugzilla.redhat.com/show_bug.cgi?id=1938806
-rw-r--r-- | python/libxml.c | 1 |
1 files changed, 1 insertions, 0 deletions
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)); } } |