From 827eb99e965d7336c524e71d37ac99b5c89ff035 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 --- src/rrdtool.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.30.2