aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-05-08 15:50:15 +0200
committerFredrik Gustafsson <[email protected]>2013-05-08 15:50:15 +0200
commitf1e3a92a13c1e58c3cb83c995af2bc5f09b512cb (patch)
treec830e4e7f909b68ef34fc47414ca0d4c7599dd80
parent89939207898fc68a2ee0c080e603aa65fb866b25 (diff)
downloadotp-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.c3
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 */