From: Sebastian Harl Date: Tue, 20 Jan 2009 12:24:54 +0000 (+0100) Subject: utils_cache: Free then unused memory before returning in an error condition. X-Git-Tag: collectd-4.6.0~19^2~2^2~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=8455c2452e0249631dbb12b9902cfdb2e61f11e7;p=collectd.git utils_cache: Free then unused memory before returning in an error condition. --- diff --git a/src/utils_cache.c b/src/utils_cache.c index 6779bba8..79384121 100644 --- a/src/utils_cache.c +++ b/src/utils_cache.c @@ -187,6 +187,7 @@ static int uc_insert (const data_set_t *ds, const value_list_t *vl, ce = cache_alloc (ds->ds_num); if (ce == NULL) { + sfree (key_copy); ERROR ("uc_insert: cache_alloc (%i) failed.", ds->ds_num); return (-1); }