From: Giuseppe Longo Date: Sat, 8 Jun 2013 02:24:35 +0000 (+0000) Subject: nft: fix leak of rule and chain iterators X-Git-Tag: v1.6.0~111^2~99 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d01b2c28c8101f0d24e1db3f146fd845c2a634e8;p=thirdparty%2Fiptables.git nft: fix leak of rule and chain iterators This patch fixes the leak of chain and rule iterators. Signed-off-by: Giuseppe Longo Signed-off-by: Pablo Neira Ayuso --- 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);