From: Ruben Kerkhof Date: Thu, 1 Jun 2017 18:37:49 +0000 (+0200) Subject: Merge branch 'collectd-5.6' into collectd-5.7 X-Git-Tag: collectd-5.7.2~2 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=edcf39cc377d2de0744412209de4eeb50ca7ed5f;hp=5a011cfd81d5ef3876d4ecb43b6bbffd151f1b03 Merge branch 'collectd-5.6' into collectd-5.7 --- diff --git a/src/amqp.c b/src/amqp.c index cd07023f..c54a1e09 100644 --- a/src/amqp.c +++ b/src/amqp.c @@ -901,7 +901,7 @@ static int camqp_config_connection(oconfig_item_t *ci, /* {{{ */ status = cf_util_get_string(child, &conf->password); else if (strcasecmp("Exchange", child->key) == 0) status = cf_util_get_string(child, &conf->exchange); - else if ((strcasecmp("ExchangeType", child->key) == 0) && !publish) + else if (strcasecmp("ExchangeType", child->key) == 0) status = cf_util_get_string(child, &conf->exchange_type); else if ((strcasecmp("Queue", child->key) == 0) && !publish) status = cf_util_get_string(child, &conf->queue); 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); } } diff --git a/src/utils_format_graphite.c b/src/utils_format_graphite.c index 4f509f4a..9c7d96f1 100644 --- a/src/utils_format_graphite.c +++ b/src/utils_format_graphite.c @@ -180,8 +180,13 @@ int format_graphite(char *buffer, size_t buffer_size, data_set_t const *ds, int buffer_pos = 0; gauge_t *rates = NULL; - if (flags & GRAPHITE_STORE_RATES) + if (flags & GRAPHITE_STORE_RATES) { rates = uc_get_rate(ds, vl); + if (rates == NULL) { + ERROR("format_graphite: error with uc_get_rate"); + return -1; + } + } for (size_t i = 0; i < ds->ds_num; i++) { char const *ds_name = NULL;