Skip to content

Commit

Permalink
Do not defer close when sockfd is -1 (#3361)
Browse files Browse the repository at this point in the history
  • Loading branch information
twose authored Jun 5, 2020
1 parent bc5d853 commit 7c9f8bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/network/socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ static void socket_free_defer(void *ptr)

void swSocket_free(swSocket *sock)
{
if (SwooleTG.reactor)
if (SwooleTG.reactor && sock->fd != -1)
{
sock->removed = 1;
swoole_event_defer(socket_free_defer, sock);
Expand Down

0 comments on commit 7c9f8bc

Please sign in to comment.