From 08ca13c8db2b28005e05d6b65a567089093c295d Mon Sep 17 00:00:00 2001 From: wpaul Date: Tue, 30 Oct 2001 18:15:48 +0000 Subject: 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(-) (limited to 'sys/netinet') diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index fbcf89b..060c4c0 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; } -- cgit v1.1