diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2003-04-01 01:09:38 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2003-04-01 01:09:38 +0000 |
commit | 4dee8196ccbef7d77b9fb8323bc8f632e4ed75ea (patch) | |
tree | d112d684f72cc0d7afed46dc14be4b58bab80bab /sys/netinet6 | |
parent | aa3be9076a77ac87c5503d598b2ac53679418e66 (diff) |
avoid memory leak on redirect header generation. from kame.
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/icmp6.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index ff7374c2a57..3a0299c8732 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: icmp6.c,v 1.65 2002/10/12 01:09:45 krw Exp $ */ +/* $OpenBSD: icmp6.c,v 1.66 2003/04/01 01:09:37 itojun Exp $ */ /* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */ /* @@ -2706,8 +2706,13 @@ icmp6_redirect_output(m0, rt) /* connect m0 to m */ m->m_next = m0; m->m_pkthdr.len = m->m_len + m0->m_len; + m0 = NULL; } noredhdropt:; + if (m0) { + m_freem(m0); + m0 = NULL; + } if (IN6_IS_ADDR_LINKLOCAL(&sip6->ip6_src)) sip6->ip6_src.s6_addr16[1] = 0; |