summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2001-10-30 18:15:48 +0000
committerwpaul <wpaul@FreeBSD.org>2001-10-30 18:15:48 +0000
commit08ca13c8db2b28005e05d6b65a567089093c295d (patch)
treea0d2db08a432cde6667945478377aed115eef5a6 /sys/netinet
parent3554d69eb7586d90560931e7765242b2d0cd614f (diff)
downloadFreeBSD-src-08ca13c8db2b28005e05d6b65a567089093c295d.zip
FreeBSD-src-08ca13c8db2b28005e05d6b65a567089093c295d.tar.gz
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
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_output.c2
1 files changed, 1 insertions, 1 deletions
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;
}
OpenPOWER on IntegriCloud