提交 4a063739 编写于 作者: C Chris Wright 提交者: David S. Miller

[NETFILTER]: SNMP NAT: fix memleak in snmp_object_decode

If kmalloc fails, error path leaks data allocated from asn1_oid_decode().
Signed-off-by: NChris Wright <chrisw@sous-sol.org>
Signed-off-by: NPatrick McHardy <kaber@trash.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4d942d8b
......@@ -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__);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册