Skip to content

Commit

Permalink
erl_interface: check if file descriptor is valid before closing
Browse files Browse the repository at this point in the history
  • Loading branch information
rimmius committed May 8, 2013
1 parent 8993920 commit f1e3a92
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/erl_interface/src/connect/ei_connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,8 @@ int ei_accept_tmo(ei_cnode* ec, int lfd, ErlConnect *conp, unsigned ms)

error:
EI_TRACE_ERR0("ei_accept","<- ACCEPT failed");
closesocket(fd);
if (fd>=0)
closesocket(fd);
return ERL_ERROR;
} /* ei_accept */

Expand Down

0 comments on commit f1e3a92

Please sign in to comment.