1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

Fix for PR #1146: the "next" pointer must be cached before calling soabort

since the struct containing it may be freed.
This commit is contained in:
David Greenman 1996-04-16 03:50:08 +00:00
parent 6ec733f455
commit 46f578e76a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=15269

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94
* $Id: uipc_socket.c,v 1.15 1996/02/13 18:16:20 wollman Exp $
* $Id: uipc_socket.c,v 1.16 1996/03/11 15:37:31 davidg Exp $
*/
#include <sys/param.h>
@ -177,12 +177,16 @@ soclose(so)
int error = 0;
if (so->so_options & SO_ACCEPTCONN) {
struct socket *sp;
struct socket *sp, *sonext;
for (sp = so->so_incomp.tqh_first; sp != NULL; sp = sp->so_list.tqe_next)
for (sp = so->so_incomp.tqh_first; sp != NULL; sp = sonext) {
sonext = sp->so_list.tqe_next;
(void) soabort(sp);
for (sp = so->so_comp.tqh_first; sp != NULL; sp = sp->so_list.tqe_next)
}
for (sp = so->so_comp.tqh_first; sp != NULL; sp = sonext) {
sonext = sp->so_list.tqe_next;
(void) soabort(sp);
}
}
if (so->so_pcb == 0)
goto discard;