Use TAILQ_FOREACH_SAFE() macro to avoid use after free in soclose().
PR: 239893 MFC after: 1 week
This commit is contained in:
parent
6261923e4c
commit
700a658772
@ -1131,9 +1131,9 @@ drop:
|
||||
so->so_state |= SS_NOFDREF;
|
||||
sorele(so);
|
||||
if (listening) {
|
||||
struct socket *sp;
|
||||
struct socket *sp, *tsp;
|
||||
|
||||
TAILQ_FOREACH(sp, &lqueue, so_list) {
|
||||
TAILQ_FOREACH_SAFE(sp, &lqueue, so_list, tsp) {
|
||||
SOCK_LOCK(sp);
|
||||
if (sp->so_count == 0) {
|
||||
SOCK_UNLOCK(sp);
|
||||
|
Loading…
x
Reference in New Issue
Block a user