From 3528d68f716b03a2e42bd3c732bf39d6e93b59bf Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Tue, 30 Oct 2001 18:15:48 +0000 Subject: [PATCH] Fix a (long standing?) bug in ip_output(): if ip_insertoptions() is called and ip_output() encounters an error and bails (i.e. host unreachable), we will leak an mbuf. This is because the code calls m_freem(m0) after jumping to the bad: label at the end of the function, when it should be calling m_freem(m). (m0 is the original mbuf list _without_ the options mbuf prepended.) Obtained from: NetBSD --- sys/netinet/ip_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index fbcf89b574a..060c4c017e5 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -982,7 +982,7 @@ done: #endif /* IPSEC */ return (error); bad: - m_freem(m0); + m_freem(m); goto done; }