Skip to content

Commit

Permalink
Bind plugin: plug a few leaks
Browse files Browse the repository at this point in the history
Fixes: #2303
  • Loading branch information
rubenk committed Jun 1, 2017
1 parent 58ef597 commit fd01cdd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/bind.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}
}

Expand Down

0 comments on commit fd01cdd

Please sign in to comment.