aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorChris Wright <chrisw@sous-sol.org>2006-05-23 15:08:13 -0700
committerDavid S. Miller <davem@sunset.sfo1.dsl.speakeasy.net>2006-05-23 15:15:13 -0700
commit4a063739138e2c4e933188d641f1593e01ce8285 (patch)
tree73b7a622babb84307abdd3e08fd57e59bf50a0b8 /net/ipv4
parent[NETFILTER]: H.323 helper: fix sequence extension parsing (diff)
downloadlinux-dev-4a063739138e2c4e933188d641f1593e01ce8285.tar.xz
linux-dev-4a063739138e2c4e933188d641f1593e01ce8285.zip
[NETFILTER]: SNMP NAT: fix memleak in snmp_object_decode
If kmalloc fails, error path leaks data allocated from asn1_oid_decode(). Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/netfilter/ip_nat_snmp_basic.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ipv4/netfilter/ip_nat_snmp_basic.c b/net/ipv4/netfilter/ip_nat_snmp_basic.c
index 688a2f29fadf..c33244263b90 100644
--- a/net/ipv4/netfilter/ip_nat_snmp_basic.c
+++ b/net/ipv4/netfilter/ip_nat_snmp_basic.c
@@ -768,6 +768,7 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
len *= sizeof(unsigned long);
*obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC);
if (*obj == NULL) {
+ kfree(lp);
kfree(id);
if (net_ratelimit())
printk("OOM in bsalg (%d)\n", __LINE__);