[NETFILTER 3/3]: SNMP NAT: fix memleak in snmp_object_decode
Patrick McHardy
kaber at trash.net
Tue May 23 11:41:53 CEST 2006
[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 at sous-sol.org>
Signed-off-by: Patrick McHardy <kaber at trash.net>
---
commit 3eb1830bb0cf13f1e9906e96b6b21d512adfbafd
tree afc2fb8b065ed275e4c5d6680858a62126b34f8b
parent e79f105111e9a6088868a879934d0574ce6230ad
author Chris Wright <chrisw at sous-sol.org> Tue, 23 May 2006 11:23:17 +0200
committer Patrick McHardy <kaber at trash.net> Tue, 23 May 2006 11:23:17 +0200
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 c622538..1017d12 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(
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__);
More information about the netfilter-devel
mailing list