From d7bfb9d61e7b3ac3eaee9079776221fca570610c Mon Sep 17 00:00:00 2001 From: Michael Keller Date: Tue, 9 May 2023 15:03:27 +1200 Subject: [PATCH] Desktop: Fix memory leak during XSLT transformation. Fix a memory leak occurring during XSLT transformations. Fixes #3899. Signed-off-by: Michael Keller --- core/parse-xml.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/parse-xml.c b/core/parse-xml.c index 9ca16772f..9affb3f81 100644 --- a/core/parse-xml.c +++ b/core/parse-xml.c @@ -2347,8 +2347,13 @@ static xmlDoc *test_xslt_transforms(xmlDoc *doc, const struct xml_params *params if ((strcasecmp((const char *)root_element->name, info->root) == 0)) { if (info->attribute == NULL) break; - else if (xmlGetProp(root_element, (const xmlChar *)info->attribute) != NULL) + + void *prop = xmlGetProp(root_element, (const xmlChar *)info->attribute); + if (prop != NULL) { + free(prop); + break; + } } info++; }