From 3b588dffcf4737f07ccf49baf6bc44a4108647c3 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Sun, 26 Mar 2017 18:46:13 -0400 Subject: Check for return value of WSAStartup on all executables. Windows vscodeanalysis complains even though the event is probably very unlikely. Change-Id: Iafe158eea5586908209d6bfe1e45540117558673 Reviewed-on: https://code.wireshark.org/review/20727 Reviewed-by: Michael Mann --- wireshark-qt.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'wireshark-qt.cpp') diff --git a/wireshark-qt.cpp b/wireshark-qt.cpp index 1f92a5de7b..d8a0afb562 100644 --- a/wireshark-qt.cpp +++ b/wireshark-qt.cpp @@ -339,6 +339,7 @@ int main(int argc, char *qt_argv[]) char **argv = qt_argv; #ifdef _WIN32 + int result; WSADATA wsaData; #endif /* _WIN32 */ @@ -509,7 +510,12 @@ int main(int argc, char *qt_argv[]) #ifdef _WIN32 /* Start windows sockets */ - WSAStartup( MAKEWORD( 1, 1 ), &wsaData ); + result = WSAStartup( MAKEWORD( 1, 1 ), &wsaData ); + if (result != 0) + { + ret_val = INIT_FAILED; + goto clean_exit; + } #endif /* _WIN32 */ /* Read the profile dependent (static part) of the recent file. */ -- cgit v1.2.3