netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Engelmayer <christian.engelmayer@frequentis.com>
To: <netfilter-devel@vger.kernel.org>
Cc: <christian.engelmayer@frequentis.com>, <franz.flasch@frequentis.com>
Subject: [PATCH] iptables: missing free() in function delete_entry()
Date: Thu, 8 Mar 2012 15:20:41 +0100	[thread overview]
Message-ID: <20120308152041.7a789c4f@frequentis.com> (raw)

From: Franz Flasch <franz.flasch@frequentis.com>

Fixed a memory leak in the dry run path of function delete_entry().

Signed-off-by: Franz Flasch <franz.flasch@frequentis.com>
Signed-off-by: Christian Engelmayer <christian.engelmayer@frequentis.com>
---

--- iptables-1.4.12.2/libiptc/libiptc.c	2012-01-02 18:19:09.000000000 +0100
+++ iptables-1.4.12.2-modified/libiptc/libiptc.c	2012-03-08 14:27:24.000000000 +0100
@@ -2001,8 +2001,10 @@ static int delete_entry(const IPT_CHAINL
 			continue;
 
 		/* if we are just doing a dry run, we simply skip the rest */
-		if (dry_run)
+		if (dry_run){
+			free(r);
 			return 1;
+		}
 
 		/* If we are about to delete the rule that is the
 		 * current iterator, move rule iterator back.  next

             reply	other threads:[~2012-03-08 14:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-08 14:20 Christian Engelmayer [this message]
2012-03-12 12:13 ` [PATCH] iptables: missing free() in function delete_entry() Pablo Neira Ayuso

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=20120308152041.7a789c4f@frequentis.com \
    --to=christian.engelmayer@frequentis.com \
    --cc=franz.flasch@frequentis.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 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).