summaryrefslogtreecommitdiff
path: root/wireshark-qt.cpp
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2017-03-26 18:46:13 -0400
committerMichael Mann <mmann78@netscape.net>2017-03-27 03:14:15 +0000
commit3b588dffcf4737f07ccf49baf6bc44a4108647c3 (patch)
treea30fab29f23656a7ec62e78cc38fb03f0d312dbe /wireshark-qt.cpp
parent520cfcf53b1c3e56ff524c89cf18fbf999a28f0c (diff)
downloadwireshark-3b588dffcf4737f07ccf49baf6bc44a4108647c3.tar.gz
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 <mmann78@netscape.net>
Diffstat (limited to 'wireshark-qt.cpp')
-rw-r--r--wireshark-qt.cpp8
1 files changed, 7 insertions, 1 deletions
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. */