From: Ruben Kerkhof Date: Sun, 29 Nov 2015 15:40:50 +0000 (+0100) Subject: rrdtool: unlock mutex on error X-Git-Tag: collectd-5.6.0~551^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=827eb99e965d7336c524e71d37ac99b5c89ff035;p=collectd.git rrdtool: unlock mutex on error CID 37972 --- diff --git a/src/rrdtool.c b/src/rrdtool.c index 764d6d65..e093f2b2 100644 --- a/src/rrdtool.c +++ b/src/rrdtool.c @@ -733,7 +733,10 @@ static int rrd_cache_insert (const char *filename, { rc = malloc (sizeof (*rc)); if (rc == NULL) + { + pthread_mutex_unlock (&cache_lock); return (-1); + } rc->values_num = 0; rc->values = NULL; rc->first_value = 0;