From 05e023f2ec8d8dc37bb0f20db1c606f06aea69f5 Mon Sep 17 00:00:00 2001 From: Dag Robole Date: Tue, 18 Jul 2017 16:24:46 +0200 Subject: Move CloseSocket out of SetSocketNonBlocking and pass SOCKET by const reference in SetSocket* functions --- src/net.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/net.cpp') diff --git a/src/net.cpp b/src/net.cpp index 5bf3af7ea3..0994af3021 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2076,6 +2076,7 @@ bool CConnman::BindListenPort(const CService &addrBind, std::string& strError, b // Set to non-blocking, incoming connections will also inherit this if (!SetSocketNonBlocking(hListenSocket, true)) { + CloseSocket(hListenSocket); strError = strprintf("BindListenPort: Setting listening socket to non-blocking failed, error %s\n", NetworkErrorString(WSAGetLastError())); LogPrintf("%s\n", strError); return false; -- cgit v1.2.3