From ed8d065642f1fd6913d976668f9a61d96ef7a73f Mon Sep 17 00:00:00 2001 From: Jason Watkins Date: Thu, 30 Apr 2015 09:30:46 -0700 Subject: [PATCH] Explicitly initialize `sock` to ~0 if WSAStartup fails. --- xpcPlugin/UDPSocket.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/xpcPlugin/UDPSocket.cpp b/xpcPlugin/UDPSocket.cpp index 3b5cf3a..da65e2b 100644 --- a/xpcPlugin/UDPSocket.cpp +++ b/xpcPlugin/UDPSocket.cpp @@ -27,6 +27,7 @@ namespace XPC #if LOG_VERBOSITY > 0 Log::FormatLine("[SOCK] ERROR: WSAStartup failed with error code %i.", startResult); #endif + this->sock = ~0; return; } if ((this->sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == INVALID_SOCKET)