* [NETFILTER 3/3]: SNMP NAT: fix memleak in snmp_object_decode
@ 2006-05-23 9:41 Patrick McHardy
0 siblings, 0 replies; only message in thread
From: Patrick McHardy @ 2006-05-23 9:41 UTC (permalink / raw)
To: David S. Miller; +Cc: Netfilter Development Mailinglist
[-- Attachment #1: 03.diff --]
[-- Type: text/plain, Size: 1133 bytes --]
[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>
---
commit 3eb1830bb0cf13f1e9906e96b6b21d512adfbafd
tree afc2fb8b065ed275e4c5d6680858a62126b34f8b
parent e79f105111e9a6088868a879934d0574ce6230ad
author Chris Wright <chrisw@sous-sol.org> Tue, 23 May 2006 11:23:17 +0200
committer Patrick McHardy <kaber@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__);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2006-05-23 9:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-23 9:41 [NETFILTER 3/3]: SNMP NAT: fix memleak in snmp_object_decode Patrick McHardy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.