mirror of https://github.com/mgba-emu/mgba.git
Util: Fix potential socket leak
This commit is contained in:
parent
001135ef91
commit
e06fa02d14
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue