netfilter: snmp nat leaks memory in case of failure
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Mon, 20 Oct 2008 10:33:24 +0000 (03:33 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Oct 2008 10:33:24 +0000 (03:33 -0700)
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/netfilter/nf_nat_snmp_basic.c

index ffeaffc3fffe6c31c78e858b9a1fa61fe71ba03e..8303e4b406c05b15245d7f89d8e0c2d16f50b992 100644 (file)
@@ -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__);