summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2013-08-09 17:51:31 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2013-12-30 23:50:43 +0100
commitc11ad7cce0d7195e12347bd4a3092ac24e19f8b4 (patch)
treebb0fe637d96053aee16665628830518921431cba
parentc167e01221fc8541240b5c0505516e35a216d0eb (diff)
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 <pablo@netfilter.org>
-rw-r--r--iptables/xtables.c23
1 files changed, 1 insertions, 22 deletions
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);