summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d678cfe)
raw | patch | inline | side by side (parent: d678cfe)
author | Bruno Prémont <bonbons@linux-vserver.org> | |
Sat, 17 Jan 2009 10:40:53 +0000 (11:40 +0100) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Sat, 17 Jan 2009 10:40:53 +0000 (11:40 +0100) |
According to libxml2 API doc, the string returned by
xmlNodeListGetString()
must be freed by the user with
xmlFree()
The attached patch adds the missing calls to xmlFree() for the ascent plugin.
xmlNodeListGetString()
must be freed by the user with
xmlFree()
The attached patch adds the missing calls to xmlFree() for the ascent plugin.
src/ascent.c | patch | blob | history |
diff --git a/src/ascent.c b/src/ascent.c
index 8c0bbec600152aee448cd34a7008eae4dadabcc0..e0b6ba2db7d586c46058a26833f0a2709eba0f01 100644 (file)
--- a/src/ascent.c
+++ b/src/ascent.c
value = strtod (str_ptr, &end_ptr);
if (str_ptr == end_ptr)
{
+ xmlFree(str_ptr);
ERROR ("ascent plugin: ascent_xml_submit_gauge: strtod failed.");
return (-1);
}
}
+ xmlFree(str_ptr);
return (ascent_submit_gauge (plugin_instance, type, type_instance, value));
} /* }}} int ascent_xml_submit_gauge */
value = strtol (str_ptr, &end_ptr, 0);
if (str_ptr == end_ptr)
{
+ xmlFree(str_ptr);
ERROR ("ascent plugin: ascent_xml_read_int: strtol failed.");
return (-1);
}
}
+ xmlFree(str_ptr);
*ret_value = value;
return (0);