From: Ilpo Järvinen Date: Mon, 20 Oct 2008 10:33:24 +0000 (-0700) Subject: netfilter: snmp nat leaks memory in case of failure X-Git-Tag: v2.6.28-rc1~104^2~3 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=311670f3ea90115f2f1840e3e9770ed71e06e6c3;p=linux-2.6-omap-h63xx.git netfilter: snmp nat leaks memory in case of failure Signed-off-by: Ilpo Järvinen Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c index ffeaffc3fff..8303e4b406c 100644 --- a/net/ipv4/netfilter/nf_nat_snmp_basic.c +++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c @@ -742,6 +742,7 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx, *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC); if (*obj == NULL) { + kfree(p); kfree(id); if (net_ratelimit()) printk("OOM in bsalg (%d)\n", __LINE__);