From d68c163723c74cc571cf368f8034dc4117926dfc Mon Sep 17 00:00:00 2001 From: David King Date: Wed, 14 Jul 2021 15:23:11 +0100 Subject: [PATCH] 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)); } }