From: Ruben Kerkhof Date: Sun, 29 Nov 2015 15:40:50 +0000 (+0100) Subject: rrdtool: unlock mutex on error X-Git-Tag: collectd-5.5.1~40^2~21 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=b78ed0cf5d6be5def5e3ea9287ffa1e785558d81;p=collectd.git rrdtool: unlock mutex on error CID 37972 Signed-off-by: Florian Forster --- diff --git a/src/rrdtool.c b/src/rrdtool.c index 192a04d7..9b5723ad 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;