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: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1386%2Fhead;p=thirdparty%2Fcollectd.git rrdtool: unlock mutex on error CID 37972 --- diff --git a/src/rrdtool.c b/src/rrdtool.c index 764d6d65d..e093f2b27 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;