From 277df4a98d11e14f7029030905e65a0804a886ff Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Tue, 16 May 2000 12:16:16 +0000 Subject: xmlGetProp appears to return malloced memory. Thus we must free it. 2000-05-16 Christopher James Lahey * e-xml-utils.c: xmlGetProp appears to return malloced memory. Thus we must free it. svn path=/trunk/; revision=3087 --- e-util/e-xml-utils.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'e-util/e-xml-utils.c') diff --git a/e-util/e-xml-utils.c b/e-util/e-xml-utils.c index 33b9d28235..89f8591e8a 100644 --- a/e-util/e-xml-utils.c +++ b/e-util/e-xml-utils.c @@ -23,6 +23,7 @@ #include #include "e-xml-utils.h" #include +#include xmlNode *e_xml_get_child_by_name(xmlNode *parent, const xmlChar *child_name) @@ -74,15 +75,17 @@ int e_xml_get_integer_prop_by_name(xmlNode *parent, const xmlChar *prop_name) { xmlChar *prop; + int ret_val = 0; g_return_val_if_fail (parent != NULL, 0); g_return_val_if_fail (prop_name != NULL, 0); prop = xmlGetProp(parent, prop_name); - if (prop) - return atoi(prop); - else - return 0; + if (prop) { + ret_val = atoi(prop); + xmlFree(prop); + } + return ret_val; } void -- cgit v1.2.3