summaryrefslogtreecommitdiff
path: root/src/socketengine_iocp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/socketengine_iocp.cpp')
-rw-r--r--src/socketengine_iocp.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/socketengine_iocp.cpp b/src/socketengine_iocp.cpp
index d780b9043..66ae7f8ba 100644
--- a/src/socketengine_iocp.cpp
+++ b/src/socketengine_iocp.cpp
@@ -54,11 +54,17 @@ bool IOCPEngine::AddFd(EventHandler* eh)
/* In range? */
if ((*fake_fd < 0) || (*fake_fd > MAX_DESCRIPTORS))
+ {
+ delete fake_fd;
return false;
+ }
/* Already an entry here */
if (ref[*fake_fd])
- DelFd(ref[fd]);
+ {
+ delete fake_fd;
+ return false;
+ }
/* are we a listen socket? */
getsockopt(eh->GetFd(), SOL_SOCKET, SO_ACCEPTCONN, (char*)&is_accept, &opt_len);