Fix socket leak on local address lookup failure

This commit is contained in:
Cameron Gutman 2018-11-30 00:33:27 -08:00
parent ade084366d
commit 361571db79

View File

@ -244,6 +244,8 @@ TcpListenerThreadProc(LPVOID Context)
targetAddress.sin_family = AF_INET;
targetAddress.sin_port = htons(tuple->port);
if (FindLocalAddressBySocket(acceptedSocket, &targetAddress.sin_addr) != 0) {
closesocket(acceptedSocket);
closesocket(targetSocket);
continue;
}