Desktop: Fix memory leak during XSLT transformation.

Fix a memory leak occurring during XSLT transformations.

Fixes #3899.

Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
Michael Keller 2023-05-09 15:03:27 +12:00 committed by bstoeger
parent 361baeda01
commit d7bfb9d61e

View file

@ -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 ((strcasecmp((const char *)root_element->name, info->root) == 0)) {
if (info->attribute == NULL) if (info->attribute == NULL)
break; 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; break;
}
} }
info++; info++;
} }