aboutsummaryrefslogtreecommitdiffstats
path: root/sharkd_daemon.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 /sharkd_daemon.c
parent520cfcf53b1c3e56ff524c89cf18fbf999a28f0c (diff)
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 'sharkd_daemon.c')
-rw-r--r--sharkd_daemon.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sharkd_daemon.c b/sharkd_daemon.c
index f927970..0dc23e6 100644
--- a/sharkd_daemon.c
+++ b/sharkd_daemon.c
@@ -73,8 +73,13 @@ socket_init(char *path)
#ifdef _WIN32
WSADATA wsaData;
+ int result;
- WSAStartup(MAKEWORD(1, 1), &wsaData);
+ result = WSAStartup(MAKEWORD(1, 1), &wsaData);
+ if (result != 0) {
+ g_warning("ERROR: WSAStartup failed with error: %d", result);
+ return INVALID_SOCKET;
+ }
#endif
#ifdef SHARKD_UNIX_SUPPORT