Util: Fix potential socket leak

This commit is contained in:
Vicki Pfau 2023-03-02 20:28:48 -08:00
parent b6e34f084f
commit b8248327a2
1 changed files with 1 additions and 0 deletions

View File

@ -204,6 +204,7 @@ static inline Socket SocketOpenTCP(int port, const struct Address* bindAddress)
err = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable));
#endif
if (err) {
SocketCloseQuiet(sock);
return INVALID_SOCKET;
}