OSDN Git Service

netfilter: snmp nat leaks memory in case of failure
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Sun, 9 Nov 2008 14:04:27 +0000 (15:04 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 9 Nov 2008 14:06:09 +0000 (15:06 +0100)
(backport of 2.6 commit 311670f3ea90115f2f1840e3e9770ed71e06e6c3)

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>
[ w@1wt.eu: file is ip_nat_snmp_basic.c in 2.4 ]
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/ipv4/netfilter/ip_nat_snmp_basic.c

index 87d71d4..d382057 100644 (file)
@@ -740,6 +740,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__);