summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorChris Wright <chrisw@sous-sol.org>2006-05-24 00:08:13 +0200
committerDavid S. Miller <davem@sunset.sfo1.dsl.speakeasy.net>2006-05-24 00:15:13 +0200
commit4a063739138e2c4e933188d641f1593e01ce8285 (patch)
tree73b7a622babb84307abdd3e08fd57e59bf50a0b8 /net
parent[NETFILTER]: H.323 helper: fix sequence extension parsing (diff)
downloadlinux-4a063739138e2c4e933188d641f1593e01ce8285.tar.xz
linux-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')
-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__);