]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
nft: fix leak of rule and chain iterators
authorGiuseppe Longo <giuseppelng@gmail.com>
Sat, 8 Jun 2013 02:24:35 +0000 (02:24 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 30 Dec 2013 22:50:32 +0000 (23:50 +0100)
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>
iptables/nft.c

index 7dad2464ce824dc9fdafebb007ec91e3842f75ba..6a4898dde1e96c4b421f28e7a7d0221406b2fa64 100644 (file)
@@ -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);