projects
/
project
/
firewall3.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1ce8986
)
Don't leak memory when encountering unknown match or target
author
Jo-Philipp Wich
<jow@openwrt.org>
Thu, 23 May 2013 12:38:56 +0000
(14:38 +0200)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Thu, 23 May 2013 12:38:56 +0000
(14:38 +0200)
iptables.c
patch
|
blob
|
history
diff --git
a/iptables.c
b/iptables.c
index f39ed1ecd5b69a29e4749743974624f0fcb38c84..cea3fcd92b60a22fc188091f76409f2467aafdcd 100644
(file)
--- a/
iptables.c
+++ b/
iptables.c
@@
-1162,7
+1162,7
@@
fw3_ipt_rule_append(struct fw3_ipt_rule *r, const char *fmt, ...)
if (!em)
{
fprintf(stderr, "fw3_ipt_rule_append(): Can't find match '%s'\n", optarg);
-
return
;
+
goto free
;
}
init_match(r, em, true);
@@
-1174,7
+1174,7
@@
fw3_ipt_rule_append(struct fw3_ipt_rule *r, const char *fmt, ...)
if (!et)
{
fprintf(stderr, "fw3_ipt_rule_append(): Can't find target '%s'\n", optarg);
-
return
;
+
goto free
;
}
break;
@@
-1263,6
+1263,7
@@
fw3_ipt_rule_append(struct fw3_ipt_rule *r, const char *fmt, ...)
free(e);
}
+free:
for (i = 1; i < r->argc; i++)
free(r->argv[i]);