X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fbind.c;fp=src%2Fbind.c;h=853b9c26a352d912d851eee8a6803f8fda42677b;hb=fd01cdd0546ccbbda7f4cf5db2d0ae28e1e770cd;hp=4860f1b6045667bcfebbb264ffb9ff2100e9ddc1;hpb=58ef5973f118ceff1e09d59414c438242091adab;p=collectd.git diff --git a/src/bind.c b/src/bind.c index 4860f1b6..853b9c26 100644 --- a/src/bind.c +++ b/src/bind.c @@ -526,8 +526,10 @@ static int bind_parse_generic_name_value(const char *xpath_expression, /* {{{ */ status = bind_xml_read_gauge(doc, counter, &value.gauge); else status = bind_xml_read_derive(doc, counter, &value.derive); - if (status != 0) + if (status != 0) { + xmlFree(name); continue; + } status = (*list_callback)(name, value, current_time, user_data); if (status == 0) @@ -659,12 +661,16 @@ static int bind_parse_generic_name_attr_value_list( status = bind_xml_read_gauge(doc, child, &value.gauge); else status = bind_xml_read_derive(doc, child, &value.derive); - if (status != 0) + if (status != 0) { + xmlFree(attr_name); continue; + } status = (*list_callback)(attr_name, value, current_time, user_data); if (status == 0) num_entries++; + + xmlFree(attr_name); } }