diff options
author | ume <ume@FreeBSD.org> | 2001-07-08 18:06:03 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2001-07-08 18:06:03 +0000 |
commit | de47f9436450d4a8920b2430e1f38438550eba50 (patch) | |
tree | 665598df5020160e72832a651a7482365844d955 /sys/netinet6 | |
parent | 9c963e8d8d8c7de1d41cf6040a71bde41622b5f9 (diff) | |
download | FreeBSD-src-de47f9436450d4a8920b2430e1f38438550eba50.zip FreeBSD-src-de47f9436450d4a8920b2430e1f38438550eba50.tar.gz |
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
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/ip6_output.c | 8 |
1 files changed, 6 insertions, 2 deletions
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; |