All of lore.kernel.org
 help / color / mirror / Atom feed
From: Giuseppe Longo <giuseppelng@gmail.com>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH] nft: fix leak of iterators
Date: Wed, 05 Jun 2013 14:43:18 +0200	[thread overview]
Message-ID: <20130605124318.4391.43073.stgit@localhost> (raw)

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

diff --git a/iptables/nft.c b/iptables/nft.c
index c18999b..0ded02d 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_chain_list_iter_destroy(list);
 	nft_rule_list_free(list);
 
 	/* the core expects 1 for success and 0 for error */
@@ -1278,6 +1280,7 @@ next:
 	}
 
 err:
+        nft_chain_list_iter_destroy(iter);
 	nft_chain_list_free(list);
 
 	/* the core expects 1 for success and 0 for error */
@@ -1391,6 +1394,7 @@ next:
 	}
 
 err:
+        nft_chain_list_iter_destroy(iter);
 	nft_chain_list_free(list);
 
 	/* chain not found */


                 reply	other threads:[~2013-06-05 12:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130605124318.4391.43073.stgit@localhost \
    --to=giuseppelng@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.