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-Url: https://git.stricted.de/?a=commitdiff_plain;h=311670f3ea90115f2f1840e3e9770ed71e06e6c3;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.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 ffeaffc3fffe..8303e4b406c0 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__);