fix double-free if a single match is used multiple times within a signle rule
(Closes: #440). However, while this fixes the double-free, it still doesn't make iptables
support two of the same matches within one rule. Apparently the last matchinfo is copied into all the previous
matchinfo instances.
diff --git a/iptables.c b/iptables.c
index e22b9ea..b66e5e1 100644
--- a/iptables.c
+++ b/iptables.c
@@ -1800,8 +1800,10 @@
for (matchp = *matches; matchp;) {
tmp = matchp->next;
- if (matchp->match->m)
+ if (matchp->match->m) {
free(matchp->match->m);
+ matchp->match->m = NULL;
+ }
free(matchp);
matchp = tmp;
}