common/xml.c: fix memory leak in lab_xml_get_bool()

This commit is contained in:
Johan Malm 2025-08-06 21:05:28 +01:00 committed by Johan Malm
parent 508df093c4
commit d87ef7568a

View file

@ -190,6 +190,7 @@ lab_xml_get_bool(xmlNode *node, const char *key, bool *b)
if (get_node(node, key, &child, /* leaf_only */ true)) {
char *s = (char *)xmlNodeGetContent(child);
int ret = parse_bool(s, -1);
xmlFree(s);
if (ret >= 0) {
*b = ret;
return true;