Skip to contentSkip to conversation

: SNMP NAT: fix memleak in snmp_object_decode

PATCH In review Patrick McHardy 1 participant 1 message May 23, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/3 : SNMP NAT: fix memleak in snmp_object_decode

[NETFILTER]: SNMP NAT: fix memleak in snmp_object_decode

If kmalloc fails, error path leaks data allocated from asn1_oid_decode().

---
commit 3eb1830bb0cf13f1e9906e96b6b21d512adfbafd
tree afc2fb8b065ed275e4c5d6680858a62126b34f8b
parent e79f105111e9a6088868a879934d0574ce6230ad
author Chris Wright <[email protected]> Tue, 23 May 2006 11:23:17 +0200 committer Patrick McHardy <[email protected]> Tue, 23 May 2006 11:23:17 +0200

 net/ipv4/netfilter/ip_nat_snmp_basic.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
net/ipv4/netfilter/ip_nat_snmp_basic.c +1 -0
index c622538..1017d12 100644
@@ -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__);