summaryrefslogtreecommitdiff
path: root/sys/kern/uipc_usrreq.c
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>1999-02-05 04:14:20 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>1999-02-05 04:14:20 +0000
commit43c7acec8dca763c1b811929f03921639eac84eb (patch)
tree29b2215d81a6e1f4cada2933cc12036f852d2028 /sys/kern/uipc_usrreq.c
parent5b2396f9751f38c1d4fad342731e608fcb0c498f (diff)
Check that a socket we're closing is really a socket. dillon@freebsd
Diffstat (limited to 'sys/kern/uipc_usrreq.c')
-rw-r--r--sys/kern/uipc_usrreq.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 1d2ef6a345a..88909a7638e 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_usrreq.c,v 1.9 1998/03/01 19:34:15 deraadt Exp $ */
+/* $OpenBSD: uipc_usrreq.c,v 1.10 1999/02/05 04:14:19 angelos Exp $ */
/* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */
/*
@@ -797,7 +797,8 @@ unp_gc()
}
}
for (i = nunref, fpp = extra_ref; --i >= 0; ++fpp)
- sorflush((struct socket *)(*fpp)->f_data);
+ if ((*fpp)->f_type == DTYPE_SOCKET && (*fpp)->f_data != NULL)
+ sorflush((struct socket *)(*fpp)->f_data);
for (i = nunref, fpp = extra_ref; --i >= 0; ++fpp)
(void) closef(*fpp, (struct proc *)0);
free((caddr_t)extra_ref, M_FILE);