projects
/
platform
/
upstream
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4f30adc
)
iptables: Free match rules
author
Daniel Wagner
<daniel.wagner@bmw-carit.de>
Thu, 21 Feb 2013 16:42:31 +0000
(17:42 +0100)
committer
Patrik Flykt
<patrik.flykt@linux.intel.com>
Fri, 22 Feb 2013 10:42:53 +0000
(12:42 +0200)
We forgot to free the match rules.
src/iptables.c
patch
|
blob
|
history
diff --git
a/src/iptables.c
b/src/iptables.c
index
44c5c73
..
9685432
100644
(file)
--- 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);
}