X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fbind.c;h=2e7c49dc1ebe0dab46629513e51025fb10563dac;hp=6b13df8eb89ea990ae9d228101e4ae86b770a8fa;hb=edcf39cc377d2de0744412209de4eeb50ca7ed5f;hpb=5a011cfd81d5ef3876d4ecb43b6bbffd151f1b03 diff --git a/src/bind.c b/src/bind.c index 6b13df8e..2e7c49dc 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); } }