summaryrefslogtreecommitdiffstats
path: root/iptables/nft.c
diff options
context:
space:
mode:
authorGiuseppe Longo <giuseppelng@gmail.com>2013-06-08 02:24:35 +0000
committerPablo Neira Ayuso <pablo@netfilter.org>2013-12-30 23:50:32 +0100
commitd01b2c28c8101f0d24e1db3f146fd845c2a634e8 (patch)
treed20be3eb9593ec88d7d2a8f76fcdffff920e172f /iptables/nft.c
parentd801b9f3b8161752ea2358a0bfb614603d28a8e5 (diff)
nft: fix leak of rule and chain iterators
This patch fixes the leak of chain and rule iterators. Signed-off-by: Giuseppe Longo <giuseppelng@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/nft.c')
-rw-r--r--iptables/nft.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/iptables/nft.c b/iptables/nft.c
index 7dad2464..6a4898dd 100644
--- a/iptables/nft.c
+++ b/iptables/nft.c
@@ -1118,6 +1118,7 @@ next:
c = nft_chain_list_iter_next(iter);
}
+ nft_chain_list_iter_destroy(iter);
nft_chain_list_free(list);
return 1;
@@ -1206,6 +1207,7 @@ next:
r = nft_rule_list_iter_next(iter);
}
+ nft_rule_list_iter_destroy(iter);
nft_rule_list_free(list);
/* the core expects 1 for success and 0 for error */
@@ -1283,6 +1285,7 @@ next:
c = nft_chain_list_iter_next(iter);
}
+ nft_chain_list_iter_destroy(iter);
err:
nft_chain_list_free(list);
@@ -1396,6 +1399,7 @@ next:
c = nft_chain_list_iter_next(iter);
}
+ nft_chain_list_iter_destroy(iter);
err:
nft_chain_list_free(list);