summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_usrreq.c
diff options
context:
space:
mode:
authortholo <tholo@openbsd.org>1996-03-14 08:11:54 +0000
committertholo <tholo@openbsd.org>1996-03-14 08:11:54 +0000
commit022296e3fb3ab92442657dc3eb4bb302d31476bb (patch)
tree34f67957bfe505b2731c839560836ba9da8ee18f /sys/netinet/tcp_usrreq.c
parentFrom Lite2; skip slow start calculation if socket state is listen (diff)
downloadwireguard-openbsd-022296e3fb3ab92442657dc3eb4bb302d31476bb.tar.xz
wireguard-openbsd-022296e3fb3ab92442657dc3eb4bb302d31476bb.zip
From Lite2; fix mbuf leak
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r--sys/netinet/tcp_usrreq.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index edd61e83389..e47e0378f77 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_usrreq.c,v 1.2 1996/03/03 22:30:49 niklas Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.3 1996/03/14 08:11:54 tholo Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
@@ -110,6 +110,12 @@ tcp_usrreq(so, req, m, nam, control)
*/
if (inp == 0 && req != PRU_ATTACH) {
splx(s);
+ /*
+ * The following corrects an mbuf leak under rare
+ * circumstances
+ */
+ if (m && (req == PRU_SEND || req == PRU_SENDOOB))
+ m_freem(m);
return (EINVAL); /* XXX */
}
if (inp) {