From b78ed0cf5d6be5def5e3ea9287ffa1e785558d81 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sun, 29 Nov 2015 16:40:50 +0100 Subject: [PATCH] rrdtool: unlock mutex on error CID 37972 Signed-off-by: Florian Forster --- src/rrdtool.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.11.0