diff options
author | Fredrik Gustafsson <[email protected]> | 2013-05-08 15:50:15 +0200 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2013-05-08 15:50:15 +0200 |
commit | f1e3a92a13c1e58c3cb83c995af2bc5f09b512cb (patch) | |
tree | c830e4e7f909b68ef34fc47414ca0d4c7599dd80 | |
parent | 89939207898fc68a2ee0c080e603aa65fb866b25 (diff) | |
download | otp-f1e3a92a13c1e58c3cb83c995af2bc5f09b512cb.tar.gz otp-f1e3a92a13c1e58c3cb83c995af2bc5f09b512cb.tar.bz2 otp-f1e3a92a13c1e58c3cb83c995af2bc5f09b512cb.zip |
erl_interface: check if file descriptor is valid before closing
-rw-r--r-- | lib/erl_interface/src/connect/ei_connect.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/erl_interface/src/connect/ei_connect.c b/lib/erl_interface/src/connect/ei_connect.c index 3ab86bb340..8f1f231b82 100644 --- a/lib/erl_interface/src/connect/ei_connect.c +++ b/lib/erl_interface/src/connect/ei_connect.c @@ -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 */ |