summaryrefslogtreecommitdiff
path: root/src/setting-language.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/setting-language.c')
-rw-r--r--src/setting-language.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/setting-language.c b/src/setting-language.c
index 7789d47..1b3e810 100644
--- a/src/setting-language.c
+++ b/src/setting-language.c
@@ -536,8 +536,10 @@ static void _tree_walk_langlist(xmlNodePtr cur)
for (cur_node = cur; cur_node; cur_node = cur_node->next) {
if (cur_node->type == XML_ELEMENT_NODE) {
- id = (char *)g_strdup((char *)xmlGetProp(cur_node, (const xmlChar *)"id"));
- name = (char *)g_strdup((char *)xmlGetProp(cur_node, (const xmlChar *)"string"));
+ xmlChar *xml_id = xmlGetProp(cur_node, (const xmlChar *)"id");
+ xmlChar *xml_name = xmlGetProp(cur_node, (const xmlChar *)"string");
+ id = (char *)g_strdup((char *)xml_id);
+ name = (char *)g_strdup((char *)xml_name);
struct _lang_menu_item *pitem = (struct _lang_menu_item *)calloc(1, sizeof(struct _lang_menu_item));
if (pitem) {
@@ -554,6 +556,8 @@ static void _tree_walk_langlist(xmlNodePtr cur)
}
FREE(id);
FREE(name);
+ xmlFree(xml_id);
+ xmlFree(xml_name);
}
}
}