diff options
author | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2013-02-21 17:42:31 +0100 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-02-22 12:42:53 +0200 |
commit | c529ad6f4ea829570fd6ce8cef66b974493de31a (patch) | |
tree | 2efaf996ff42839a1dcdb58d8dcd86961872b050 /src/iptables.c | |
parent | 4f30adc930c73036c6d1a146cdb21933af38e0d4 (diff) | |
download | connman-c529ad6f4ea829570fd6ce8cef66b974493de31a.tar.gz connman-c529ad6f4ea829570fd6ce8cef66b974493de31a.tar.bz2 connman-c529ad6f4ea829570fd6ce8cef66b974493de31a.zip |
iptables: Free match rules
We forgot to free the match rules.
Diffstat (limited to 'src/iptables.c')
-rw-r--r-- | src/iptables.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/iptables.c b/src/iptables.c index 44c5c73c..9685432d 100644 --- a/src/iptables.c +++ b/src/iptables.c @@ -2046,6 +2046,8 @@ static void reset_xtables(void) static void cleanup_parse_context(struct parse_context *ctx) { + struct xtables_rule_match *rm, *tmp; + g_strfreev(ctx->argv); g_free(ctx->ip); if (ctx->xt_t != NULL) { @@ -2056,6 +2058,13 @@ static void cleanup_parse_context(struct parse_context *ctx) g_free(ctx->xt_m->m); ctx->xt_m->m = NULL; } + for (tmp = NULL, rm = ctx->xt_rm; rm != NULL; rm = rm->next) { + if (tmp != NULL) + g_free(tmp); + tmp = rm; + } + g_free(tmp); + g_free(ctx); } |