From: Florian Forster Date: Sat, 18 Nov 2017 08:55:58 +0000 (+0100) Subject: Merge branch 'collectd-5.7' into collectd-5.8 X-Git-Tag: collectd-5.8.0~1 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=8fd8f76dc11064e75e44448d16d35e09e46191a2;hp=ce13502b2a127ec38f851422cb8b0ccf0da5e52a;p=collectd.git Merge branch 'collectd-5.7' into collectd-5.8 --- diff --git a/src/gps.c b/src/gps.c index 210c2934..ecb4bbaa 100644 --- a/src/gps.c +++ b/src/gps.c @@ -307,7 +307,6 @@ static int cgps_shutdown(void) { free(res); // Clean mutex: - pthread_mutex_unlock(&cgps_thread_lock); pthread_mutex_destroy(&cgps_thread_lock); pthread_mutex_unlock(&cgps_data_lock); pthread_mutex_destroy(&cgps_data_lock); diff --git a/src/snmp.c b/src/snmp.c index 0a20e34b..8cb866d3 100644 --- a/src/snmp.c +++ b/src/snmp.c @@ -1432,8 +1432,12 @@ static int csnmp_read_table(host_definition_t *host, data_definition_t *data) { for (vb = res->variables, i = 0; (vb != NULL); vb = vb->next_variable, i++) { /* Calculate value index from todo list */ - while ((i < oid_list_len) && !oid_list_todo[i]) + while ((i < oid_list_len) && !oid_list_todo[i]) { i++; + } + if (i >= oid_list_len) { + break; + } /* An instance is configured and the res variable we process is the * instance value (last index) */ diff --git a/src/write_riemann.c b/src/write_riemann.c index 6db3ef58..86f0c1fa 100644 --- a/src/write_riemann.c +++ b/src/write_riemann.c @@ -610,6 +610,7 @@ static void wrr_free(void *p) /* {{{ */ wrr_disconnect(host); + pthread_mutex_lock(&host->lock); pthread_mutex_destroy(&host->lock); sfree(host); } /* }}} void wrr_free */