diff options
author | 2003-04-01 01:09:37 +0000 | |
---|---|---|
committer | 2003-04-01 01:09:37 +0000 | |
commit | 3669202578493629ebd8043f2e011fc81389dcf8 (patch) | |
tree | 060449cec4e6185d01d5d7b473a27deb3f3cfc7f | |
parent | Treat empty environment variables the same as NULL. henning@ OK (diff) | |
download | wireguard-openbsd-3669202578493629ebd8043f2e011fc81389dcf8.tar.xz wireguard-openbsd-3669202578493629ebd8043f2e011fc81389dcf8.zip |
avoid memory leak on redirect header generation. from kame.
-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; |