diff options
author | Chris Wright <chrisw@sous-sol.org> | 2006-05-23 15:08:13 -0700 |
---|---|---|
committer | David S. Miller <davem@sunset.sfo1.dsl.speakeasy.net> | 2006-05-23 15:15:13 -0700 |
commit | 4a063739138e2c4e933188d641f1593e01ce8285 (patch) | |
tree | 73b7a622babb84307abdd3e08fd57e59bf50a0b8 /net | |
parent | 4d942d8b39bf7d43ce93d85964aeb63aeace0593 (diff) |
[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.c | 1 |
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 688a2f29fad..c33244263b9 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__); |