From 5d7873021242bd5fb2b94aa539455911b3aea5a9 Mon Sep 17 00:00:00 2001 From: Stéphane Raimbault Date: Wed, 6 Oct 2010 09:00:33 +0200 Subject: [PATCH] Add missing return when the init of Win32 Socket API fails --- src/modbus-tcp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modbus-tcp.c b/src/modbus-tcp.c index f238977..7d7e75a 100644 --- a/src/modbus-tcp.c +++ b/src/modbus-tcp.c @@ -274,7 +274,9 @@ int _modbus_tcp_listen(modbus_t *ctx, int nb_connection) modbus_tcp_t *ctx_tcp = ctx->backend_data; #ifdef NATIVE_WIN32 - _modbus_tcp_init_win32(); + if (_modbus_tcp_init_win32() == -1) { + return -1; + } #endif new_socket = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); -- libgit2 0.21.4