diff options
author | suz <suz@FreeBSD.org> | 2007-05-04 02:34:17 +0000 |
---|---|---|
committer | suz <suz@FreeBSD.org> | 2007-05-04 02:34:17 +0000 |
commit | d1094dd495c0bca4503b7ef05a6679f9f079e957 (patch) | |
tree | 8bd6c3cb87bafe0c3c638a10cd76390c3caa85e9 /sys/netinet6/nd6_nbr.c | |
parent | 0eab9692b55624688d6a271bf08293f710b7bb9d (diff) | |
download | FreeBSD-src-d1094dd495c0bca4503b7ef05a6679f9f079e957.zip FreeBSD-src-d1094dd495c0bca4503b7ef05a6679f9f079e957.tar.gz |
fixed a memory leak in unresolved ND queue processing
Obtained from: KAME
MFC after: 1 week
Diffstat (limited to 'sys/netinet6/nd6_nbr.c')
-rw-r--r-- | sys/netinet6/nd6_nbr.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index fefcc99..d4d335c 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -818,24 +818,17 @@ nd6_na_input(m, off, icmp6len) if (ln->ln_hold) { struct mbuf *m_hold, *m_hold_next; - for (m_hold = ln->ln_hold; m_hold; m_hold = m_hold_next) { - struct mbuf *mpkt = NULL; - + for (m_hold = ln->ln_hold, ln->ln_hold = NULL; + m_hold; m_hold = m_hold_next) { m_hold_next = m_hold->m_nextpkt; - mpkt = m_copym(m_hold, 0, M_COPYALL, M_DONTWAIT); - if (mpkt == NULL) { - m_freem(m_hold); - break; - } - mpkt->m_nextpkt = NULL; + m_hold->m_nextpkt = NULL; /* * we assume ifp is not a loopback here, so just set * the 2nd argument as the 1st one. */ - nd6_output(ifp, ifp, mpkt, + nd6_output(ifp, ifp, m_hold, (struct sockaddr_in6 *)rt_key(rt), rt); } - ln->ln_hold = NULL; } freeit: |