mirror of
https://github.com/moonlight-stream/GS-IPv6-Forwarder.git
synced 2026-06-22 08:20:55 +00:00
Fix socket leak on local address lookup failure
This commit is contained in:
@@ -244,6 +244,8 @@ TcpListenerThreadProc(LPVOID Context)
|
|||||||
targetAddress.sin_family = AF_INET;
|
targetAddress.sin_family = AF_INET;
|
||||||
targetAddress.sin_port = htons(tuple->port);
|
targetAddress.sin_port = htons(tuple->port);
|
||||||
if (FindLocalAddressBySocket(acceptedSocket, &targetAddress.sin_addr) != 0) {
|
if (FindLocalAddressBySocket(acceptedSocket, &targetAddress.sin_addr) != 0) {
|
||||||
|
closesocket(acceptedSocket);
|
||||||
|
closesocket(targetSocket);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user