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.5.3~9^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8455c2452e0249631dbb12b9902cfdb2e61f11e7;p=thirdparty%2Fcollectd.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 6779bba86..793841213 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); }