From 46c43ee828be268651c441475d9b6cd441576644 Mon Sep 17 00:00:00 2001 From: Stéphane Raimbault Date: Mon, 28 Nov 2022 11:10:18 +0100 Subject: [PATCH] Fix wrong close on recent commit 5a6efec --- src/modbus-tcp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modbus-tcp.c b/src/modbus-tcp.c index d808d56..8389eae 100644 --- a/src/modbus-tcp.c +++ b/src/modbus-tcp.c @@ -556,8 +556,7 @@ int modbus_tcp_listen(modbus_t *ctx, int nb_connection) if (ctx->debug) { fprintf(stderr, "Invalid IP address: %s\n", ctx_tcp->ip); } - close(ctx->s); - ctx->s = -1; + close(new_s); return -1; } } -- libgit2 0.21.4