From de47f9436450d4a8920b2430e1f38438550eba50 Mon Sep 17 00:00:00 2001 From: ume Date: Sun, 8 Jul 2001 18:06:03 +0000 Subject: 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 --- sys/netinet6/ip6_output.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sys/netinet6') diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 9a6c61e..fbe8821 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -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; -- cgit v1.1