aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net.cpp6
-rw-r--r--src/netbase.cpp9
2 files changed, 8 insertions, 7 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 657a39bcff..a0208c9605 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -946,11 +946,7 @@ void ThreadSocketHandler()
}
else if (nInbound >= nMaxConnections - MAX_OUTBOUND_CONNECTIONS)
{
- {
- LOCK(cs_setservAddNodeAddresses);
- if (!setservAddNodeAddresses.count(addr))
- closesocket(hSocket);
- }
+ closesocket(hSocket);
}
else if (CNode::IsBanned(addr))
{
diff --git a/src/netbase.cpp b/src/netbase.cpp
index d5b75d6afd..2b300e5dd3 100644
--- a/src/netbase.cpp
+++ b/src/netbase.cpp
@@ -293,8 +293,10 @@ bool static Socks5(string strDest, int port, SOCKET& hSocket)
case 0x03:
{
ret = recv(hSocket, pchRet3, 1, 0) != 1;
- if (ret)
+ if (ret) {
+ closesocket(hSocket);
return error("Error reading from proxy");
+ }
int nRecv = pchRet3[0];
ret = recv(hSocket, pchRet3, nRecv, 0) != nRecv;
break;
@@ -501,6 +503,7 @@ bool ConnectSocket(const CService &addrDest, SOCKET& hSocketRet, int nTimeout)
return false;
break;
default:
+ closesocket(hSocket);
return false;
}
@@ -532,7 +535,9 @@ bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest
switch(nameproxy.second) {
default:
- case 4: return false;
+ case 4:
+ closesocket(hSocket);
+ return false;
case 5:
if (!Socks5(strDest, port, hSocket))
return false;