From: Ruben Kerkhof Date: Sat, 5 Dec 2015 12:39:03 +0000 (+0100) Subject: utils_cache.c: plug leak on error X-Git-Tag: collectd-5.5.1~25^2~5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e1bc245ae043eab39888d87a953ee86973839e11;p=collectd.git utils_cache.c: plug leak on error CID #38000 Signed-off-by: Florian Forster --- 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) */