X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fwrite_riemann.c;h=00852ffbf2c851665196252ea45f2b445d8655f0;hb=4fdd7193481b638a059d6fa047542312e41ea45e;hp=20f2e10b91b50b4fe0165db17dec7ff9b7449ef3;hpb=d0408cb0dbef15d739a6b1cd047e9c94d7643329;p=collectd.git diff --git a/src/write_riemann.c b/src/write_riemann.c index 20f2e10b..00852ffb 100644 --- a/src/write_riemann.c +++ b/src/write_riemann.c @@ -36,7 +36,6 @@ #include "utils_complain.h" #include "write_riemann_threshold.h" -#include #include #define RIEMANN_HOST "localhost" @@ -602,6 +601,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 */ @@ -686,7 +686,8 @@ static int wrr_config_node(oconfig_item_t *ci) /* {{{ */ if (status != 0) break; #else - WARNING("write_riemann plugin: The Timeout option is not supported. Please upgrade the Riemann client to at least 1.8.0."); + WARNING("write_riemann plugin: The Timeout option is not supported. " + "Please upgrade the Riemann client to at least 1.8.0."); #endif } else if (strcasecmp("Port", child->key) == 0) { host->port = cf_util_get_port_number(child); @@ -795,10 +796,7 @@ static int wrr_config_node(oconfig_item_t *ci) /* {{{ */ ssnprintf(callback_name, sizeof(callback_name), "write_riemann/%s", host->name); - user_data_t ud = { - .data = host, - .free_func = wrr_free - }; + user_data_t ud = {.data = host, .free_func = wrr_free}; pthread_mutex_lock(&host->lock);