Util: Fix potential socket leak

This commit is contained in:
Vicki Pfau 2023-03-02 20:28:48 -08:00
parent 001135ef91
commit e06fa02d14
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;
}