From c11ad7cce0d7195e12347bd4a3092ac24e19f8b4 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 9 Aug 2013 17:51:31 +0200 Subject: xtables: use xtables_rule_matches_free Thus, we can kill clear_rule_matches. Not required since we are based upon 1.4.19.1. Signed-off-by: Pablo Neira Ayuso --- iptables/xtables.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'iptables') diff --git a/iptables/xtables.c b/iptables/xtables.c index 946f04d6..3e6092f2 100644 --- a/iptables/xtables.c +++ b/iptables/xtables.c @@ -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); -- cgit v1.2.3