]> git.mdlowis.com Git - proto/labwc.git/commitdiff
common/xml.c: fix memory leak in lab_xml_get_bool()
authorJohan Malm <jgm323@gmail.com>
Wed, 6 Aug 2025 20:05:28 +0000 (21:05 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Wed, 6 Aug 2025 20:11:42 +0000 (21:11 +0100)
src/common/xml.c

index 797af9c0eb3d5418dbc3abdd9f9b0af7120eba15..4868d7ed5385474570fcb8670579e8594ee66c52 100644 (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;