Skip to content

Commit

Permalink
[IPV6]: Fix memory management error during setting up new advapi sock…
Browse files Browse the repository at this point in the history
…opts.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
  • Loading branch information
YOSHIFUJI Hideaki committed Nov 20, 2005
1 parent 741b225 commit 8b8aa4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/ipv6/exthdrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt,
if (!tot_len)
return NULL;

tot_len += sizeof(*opt2);
opt2 = sock_kmalloc(sk, tot_len, GFP_ATOMIC);
if (!opt2)
return ERR_PTR(-ENOBUFS);
Expand Down Expand Up @@ -668,7 +669,7 @@ ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt,

return opt2;
out:
sock_kfree_s(sk, p, tot_len);
sock_kfree_s(sk, opt2, opt2->tot_len);
return ERR_PTR(err);
}

0 comments on commit 8b8aa4b

Please sign in to comment.