Explicitly initialize sock to ~0 if WSAStartup fails.
This commit is contained in:
@@ -27,6 +27,7 @@ namespace XPC
|
|||||||
#if LOG_VERBOSITY > 0
|
#if LOG_VERBOSITY > 0
|
||||||
Log::FormatLine("[SOCK] ERROR: WSAStartup failed with error code %i.", startResult);
|
Log::FormatLine("[SOCK] ERROR: WSAStartup failed with error code %i.", startResult);
|
||||||
#endif
|
#endif
|
||||||
|
this->sock = ~0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((this->sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == INVALID_SOCKET)
|
if ((this->sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == INVALID_SOCKET)
|
||||||
|
|||||||
Reference in New Issue
Block a user