netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] nft: fix leak of iterators
@ 2013-06-08 12:24 Giuseppe Longo
  2013-06-08 12:46 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Giuseppe Longo @ 2013-06-08 12:24 UTC (permalink / raw)
  To: netfilter-devel

This patch fix leak of iterators
Signed-off-by: Giuseppe Longo <giuseppelng@gmail.com>
---
 iptables/nft.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/iptables/nft.c b/iptables/nft.c
index c18999b..5a0b814 100644
--- a/iptables/nft.c
+++ b/iptables/nft.c
@@ -1112,6 +1112,7 @@ next:
 		c = nft_chain_list_iter_next(iter);
 	}
 
+	nft_chain_list_iter_destroy(iter);
 	nft_chain_list_free(list);
 
 	return 1;
@@ -1200,6 +1201,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 */
@@ -1276,6 +1278,8 @@ int nft_rule_flush(struct nft_handle *h, const char *chain, const char *table)
 next:
 		c = nft_chain_list_iter_next(iter);
 	}
+	
+	nft_chain_list_iter_destroy(iter);
 
 err:
 	nft_chain_list_free(list);
@@ -1390,6 +1394,8 @@ next:
 		c = nft_chain_list_iter_next(iter);
 	}
 
+	nft_chain_list_iter_destroy(iter);
+
 err:
 	nft_chain_list_free(list);
 


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] nft: fix leak of iterators
  2013-06-08 12:24 [PATCH v2] nft: fix leak of iterators Giuseppe Longo
@ 2013-06-08 12:46 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2013-06-08 12:46 UTC (permalink / raw)
  To: Giuseppe Longo; +Cc: netfilter-devel

On Sat, Jun 08, 2013 at 02:24:35PM +0200, Giuseppe Longo wrote:
> This patch fix leak of iterators

Applied, thanks Giuseppe.

We are still leaking list objects (track function nft_rule_list_get)
it has to be released as well. Can you send me a patch for that as
well?

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-08 12:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-08 12:24 [PATCH v2] nft: fix leak of iterators Giuseppe Longo
2013-06-08 12:46 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).