Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a063739 authored by Chris Wright's avatar Chris Wright Committed by David S. Miller
Browse files

[NETFILTER]: SNMP NAT: fix memleak in snmp_object_decode



If kmalloc fails, error path leaks data allocated from asn1_oid_decode().

Signed-off-by: default avatarChris Wright <chrisw@sous-sol.org>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4d942d8b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -768,6 +768,7 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
			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__);