[PATCH] Fix memory management error during setting up new advapi sockopts.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
YOSHIFUJI Hideaki 2005-11-21 19:07:25 +09:00 committed by Chris Wright
parent ebf1bbfda5
commit 0527c1095d

View file

@ -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);
@ -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);
}