diff options
author | David King <dking@redhat.com> | 2021-05-21 11:27:53 +0100 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2022-02-12 20:42:36 +0000 |
commit | 7e74460c9a781ec7dc08cc2d3a2341baf0435e2b (patch) | |
tree | 739829def2e98e02c48bfb0c005af7dd339bb5ea | |
parent | 2d71b9e86d12733f48451fb5623eedd92ea05919 (diff) | |
download | libxslt-7e74460c9a781ec7dc08cc2d3a2341baf0435e2b.tar.gz |
Fix memory leak in xsltDocumentElem
Found by Coverity.
https://bugzilla.redhat.com/show_bug.cgi?id=1938808
-rw-r--r-- | libxslt/transform.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libxslt/transform.c b/libxslt/transform.c index 3aba354f..57f05bf7 100644 --- a/libxslt/transform.c +++ b/libxslt/transform.c @@ -3631,8 +3631,10 @@ xsltDocumentElem(xsltTransformContextPtr ctxt, xmlNodePtr node, if (elements != NULL) { if (style->stripSpaces == NULL) style->stripSpaces = xmlHashCreate(10); - if (style->stripSpaces == NULL) + if (style->stripSpaces == NULL) { + xmlFree(elements); return; + } element = elements; while (*element != 0) { |