]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
xtables: use xtables_rule_matches_free
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 9 Aug 2013 15:51:31 +0000 (17:51 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 30 Dec 2013 22:50:43 +0000 (23:50 +0100)
Thus, we can kill clear_rule_matches. Not required since we are based
upon 1.4.19.1.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
iptables/xtables.c

index 946f04d62b80de7c4197a62f68980d65c5db7780..3e6092f2293a43cb1bcbf3d0f7e3255c51d733fb 100644 (file)
@@ -600,27 +600,6 @@ list_rules(struct nft_handle *h, const char *chain, const char *table,
        return 1;
 }
 
-static void clear_rule_matches(struct xtables_rule_match **matches)
-{
-       struct xtables_rule_match *matchp, *tmp;
-
-       for (matchp = *matches; matchp;) {
-               tmp = matchp->next;
-               if (matchp->match->m) {
-                       free(matchp->match->m);
-                       matchp->match->m = NULL;
-               }
-               if (matchp->match == matchp->match->next) {
-                       free(matchp->match);
-                       matchp->match = NULL;
-               }
-               free(matchp);
-               matchp = tmp;
-       }
-
-       *matches = NULL;
-}
-
 static void command_jump(struct iptables_command_state *cs)
 {
        size_t size;
@@ -1245,7 +1224,7 @@ int do_commandx(struct nft_handle *h, int argc, char *argv[], char **table)
 /*     if (verbose > 1)
                dump_entries(*handle); */
 
-       clear_rule_matches(&cs.matches);
+       xtables_rule_matches_free(&cs.matches);
 
        if (h->family == AF_INET) {
                free(args.s.addr.v4);