summaryrefslogtreecommitdiffstats
path: root/net/base/tcp_client_socket_libevent.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/base/tcp_client_socket_libevent.cc')
-rw-r--r--net/base/tcp_client_socket_libevent.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/base/tcp_client_socket_libevent.cc b/net/base/tcp_client_socket_libevent.cc
index 2bf3f8d..79909c20 100644
--- a/net/base/tcp_client_socket_libevent.cc
+++ b/net/base/tcp_client_socket_libevent.cc
@@ -101,6 +101,8 @@ int TCPClientSocket::Connect(CompletionCallback* callback) {
if (errno != EINPROGRESS) {
DLOG(INFO) << "connect failed: " << errno;
+ close(socket_);
+ socket_ = kInvalidSocket;
return MapPosixError(errno);
}