Skip to content

Commit

Permalink
[NETFILTER]: SNMP NAT: fix memleak in snmp_object_decode
Browse files Browse the repository at this point in the history
If kmalloc fails, error path leaks data allocated from asn1_oid_decode().

Signed-off-by: Chris Wright <[email protected]>
Signed-off-by: Patrick McHardy <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
chriswright authored and David S. Miller committed May 23, 2006
1 parent 4d942d8 commit 4a06373
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/ipv4/netfilter/ip_nat_snmp_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__);
Expand Down

0 comments on commit 4a06373

Please sign in to comment.