From: Pierre-Yves Ritschard Date: Wed, 13 Apr 2016 20:17:57 +0000 (+0200) Subject: write_riemann: avoid deadlock on connection failures X-Git-Tag: collectd-5.6.0~339^2~6^2~3 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=7201bb06faac7d7573399406f8bbfe1401111414 write_riemann: avoid deadlock on connection failures --- diff --git a/src/write_riemann.c b/src/write_riemann.c index 2b68e883..63e89186 100644 --- a/src/write_riemann.c +++ b/src/write_riemann.c @@ -135,8 +135,10 @@ static int wrr_send(struct riemann_host *host, riemann_message_t *msg) /* {{{ */ pthread_mutex_lock (&host->lock); status = wrr_connect(host); - if (status != 0) + if (status != 0) { + pthread_mutex_unlock(&host->lock); return status; + } status = riemann_client_send_message(host->client, msg); if (status != 0) {