mirror of
https://github.com/labwc/labwc.git
synced 2025-10-31 22:25:34 -04:00
common/xml.c: fix memory leak in lab_xml_get_bool()
This commit is contained in:
parent
508df093c4
commit
d87ef7568a
1 changed files with 1 additions and 0 deletions
|
|
@ -190,6 +190,7 @@ lab_xml_get_bool(xmlNode *node, const char *key, bool *b)
|
||||||
if (get_node(node, key, &child, /* leaf_only */ true)) {
|
if (get_node(node, key, &child, /* leaf_only */ true)) {
|
||||||
char *s = (char *)xmlNodeGetContent(child);
|
char *s = (char *)xmlNodeGetContent(child);
|
||||||
int ret = parse_bool(s, -1);
|
int ret = parse_bool(s, -1);
|
||||||
|
xmlFree(s);
|
||||||
if (ret >= 0) {
|
if (ret >= 0) {
|
||||||
*b = ret;
|
*b = ret;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue