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/ip6tables.c b/ip6tables.c
index 6afe68f..e2c514e 100644
--- a/ip6tables.c
+++ b/ip6tables.c
@@ -1691,8 +1691,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;
}