From e1bc245ae043eab39888d87a953ee86973839e11 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sat, 5 Dec 2015 13:39:03 +0100 Subject: [PATCH] utils_cache.c: plug leak on error CID #38000 Signed-off-by: Florian Forster --- src/utils_cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils_cache.c b/src/utils_cache.c index 910e30b2..5598f687 100644 --- a/src/utils_cache.c +++ b/src/utils_cache.c @@ -186,12 +186,13 @@ static int uc_insert (const data_set_t *ds, const value_list_t *vl, / CDTIME_T_TO_DOUBLE (vl->interval); ce->values_raw[i].absolute = vl->values[i].absolute; break; - + default: /* This shouldn't happen. */ ERROR ("uc_insert: Don't know how to handle data source type %i.", ds->ds[i].type); sfree (key_copy); + cache_free (ce); return (-1); } /* switch (ds->ds[i].type) */ } /* for (i) */ -- 2.11.0