soopt_mcopyout() frees mbuf if error occurs, and DOES NOT free it if it is

successful.
This part was lacked during merge.

Obtained from:	KAME
MFC after:	1 week
This commit is contained in:
Hajimu UMEMOTO 2001-07-08 18:06:03 +00:00
parent 2ce0498bd7
commit 89349143ab
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=79426

View File

@ -1537,8 +1537,12 @@ do { \
case IPV6_PKTOPTIONS:
if (in6p->in6p_options) {
error = soopt_mcopyout(sopt,
in6p->in6p_options);
struct mbuf *m;
m = m_copym(in6p->in6p_options,
0, M_COPYALL, M_WAIT);
error = soopt_mcopyout(sopt, m);
if (error == 0)
m_freem(m);
} else
sopt->sopt_valsize = 0;
break;