From: Sven Trenkel Date: Thu, 30 Sep 2010 10:59:21 +0000 (+0200) Subject: Fixed possible memory leak in case of broken match_value configs. X-Git-Tag: collectd-4.9.4~9 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bdc070621a45ebe7274a8125b32240abadaca9a0;p=collectd.git Fixed possible memory leak in case of broken match_value configs. --- diff --git a/src/match_value.c b/src/match_value.c index 9f02226b..ae6282c4 100644 --- a/src/match_value.c +++ b/src/match_value.c @@ -53,9 +53,18 @@ struct mv_match_s */ static void mv_free_match (mv_match_t *m) /* {{{ */ { + int i; + if (m == NULL) return; + if (m->data_sources != NULL) + { + for (i = 0; i < m->data_sources_num; ++i) + free(m->data_sources[i]); + free(m->data_sources); + } + free (m); } /* }}} void mv_free_match */