From: Ruben Kerkhof Date: Fri, 9 Dec 2016 17:15:29 +0000 (+0100) Subject: target_set: plug leak on error X-Git-Tag: collectd-5.7.1~15^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=872f146a794e43a3a4969927d55e22be8f2c8ee1;p=collectd.git target_set: plug leak on error CID 157645 --- diff --git a/src/target_set.c b/src/target_set.c index 5bf40fa3..7d54c93b 100644 --- a/src/target_set.c +++ b/src/target_set.c @@ -358,6 +358,7 @@ static int ts_invoke(const data_set_t *ds, value_list_t *vl, /* {{{ */ ERROR("Target `set': Unable to get replacement metadata value `%s'.", key); strarray_free(meta_toc, (size_t)meta_entries); + meta_data_destroy(new_meta); return (status); } @@ -373,6 +374,7 @@ static int ts_invoke(const data_set_t *ds, value_list_t *vl, /* {{{ */ if (status) { ERROR("Target `set': Unable to set metadata value `%s'.", key); strarray_free(meta_toc, (size_t)meta_entries); + meta_data_destroy(new_meta); return (status); } }