summaryrefslogtreecommitdiff
path: root/tshark.c
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 /tshark.c
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 'tshark.c')
-rw-r--r--tshark.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tshark.c b/tshark.c
index 68964bbd57..3ccb2d8467 100644
--- a/tshark.c
+++ b/tshark.c
@@ -661,6 +661,7 @@ main(int argc, char *argv[])
gboolean arg_error = FALSE;
#ifdef _WIN32
+ int result;
WSADATA wsaData;
#endif /* _WIN32 */
@@ -1769,7 +1770,12 @@ main(int argc, char *argv[])
#ifdef _WIN32
/* Start windows sockets */
- WSAStartup( MAKEWORD( 1, 1 ), &wsaData );
+ result = WSAStartup( MAKEWORD( 1, 1 ), &wsaData );
+ if (result != 0)
+ {
+ exit_status = INIT_FAILED;
+ goto clean_exit;
+ }
#endif /* _WIN32 */
/* Notify all registered modules that have had any of their preferences