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 cache_add_entry()
Date: Thu, 8 Mar 2012 15:20:37 +0100	[thread overview]
Message-ID: <20120308152037.639adf51@frequentis.com> (raw)

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

Fixed a memory leak in the error path of function cache_add_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:24:24.000000000 +0100
@@ -1012,6 +1012,7 @@ new_rule:
 			if (t->target.u.target_size
 			    != ALIGN(sizeof(STRUCT_STANDARD_TARGET))) {
 				errno = EINVAL;
+				free(r);
 				return -1;
 			}
 

             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:09 ` [PATCH] iptables: missing free() in function cache_add_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=20120308152037.639adf51@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).