mirror of https://github.com/mgba-emu/mgba.git
Util: Fix potential socket leak
This commit is contained in:
parent
b6e34f084f
commit
b8248327a2
|
@ -204,6 +204,7 @@ static inline Socket SocketOpenTCP(int port, const struct Address* bindAddress)
|
||||||
err = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable));
|
err = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable));
|
||||||
#endif
|
#endif
|
||||||
if (err) {
|
if (err) {
|
||||||
|
SocketCloseQuiet(sock);
|
||||||
return INVALID_SOCKET;
|
return INVALID_SOCKET;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue