X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fbind.c;h=b7308ad83ae7707a9b992aa0a168f1b9ae850593;hb=1035fba8812893e50d00a871e3399cc1ece3b384;hp=02bffd3d226d9db6a64a548952d5cffdf46a2ad7;hpb=b165cd13cd30a30ac830df1f6f6fbd52474a6f64;p=collectd.git diff --git a/src/bind.c b/src/bind.c index 02bffd3d..b7308ad8 100644 --- a/src/bind.c +++ b/src/bind.c @@ -522,8 +522,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) @@ -655,12 +657,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); } }