netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Patrick McHardy <kaber@trash.net>,
	netfilter-devel@vger.kernel.org
Subject: netfilter 04/07: snmp nat leaks memory in case of failure
Date: Mon, 20 Oct 2008 11:54:13 +0200 (MEST)	[thread overview]
Message-ID: <20081020095413.25670.77921.sendpatchset@x2.localnet> (raw)
In-Reply-To: <20081020095408.25670.37455.sendpatchset@x2.localnet>

commit f935265f6041e490715ec31c7f918b8c348b5b95
Author: \"Ilpo Jarvinen\ <ilpo.jarvinen@helsinki.fi>
Date:   Sat Oct 18 15:20:56 2008 +0200

    netfilter: snmp nat leaks memory in case of failure
    
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
    Signed-off-by: Patrick McHardy <kaber@trash.net>

diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c
index ffeaffc..8303e4b 100644
--- a/net/ipv4/netfilter/nf_nat_snmp_basic.c
+++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c
@@ -742,6 +742,7 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
 			*obj = kmalloc(sizeof(struct snmp_object) + len,
 				       GFP_ATOMIC);
 			if (*obj == NULL) {
+				kfree(p);
 				kfree(id);
 				if (net_ratelimit())
 					printk("OOM in bsalg (%d)\n", __LINE__);

  parent reply	other threads:[~2008-10-20  9:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-20  9:54 netfilter 00/07: netfilter fixes Patrick McHardy
2008-10-20  9:54 ` netfilter 01/07: ctnetlink: remove obsolete NAT dependency from Kconfig Patrick McHardy
2008-10-20  9:54 ` netfilter 02/07: netns: use NFPROTO_NUMPROTO instead of NUMPROTO for tables array Patrick McHardy
2008-10-20  9:54 ` netfilter 03/07: xt_iprange: fix range inversion match Patrick McHardy
2008-10-20  9:54 ` Patrick McHardy [this message]
2008-10-20  9:54 ` netfilter 05/07: xt_recent: use proc_create_data() Patrick McHardy
2008-10-20  9:54 ` netfilter 06/07: fix compilation error with NAT=n Patrick McHardy
2008-10-20  9:54 ` netfilter 07/07: replace old NF_ARP calls with NFPROTO_ARP Patrick McHardy
2008-10-20 10:35 ` netfilter 00/07: netfilter fixes David Miller

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=20081020095413.25670.77921.sendpatchset@x2.localnet \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --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).