Skip to content

Commit 46c43ee

Browse files
committed
Fix wrong close on recent commit 5a6efec
1 parent 92dca47 commit 46c43ee

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/modbus-tcp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,7 @@ int modbus_tcp_listen(modbus_t *ctx, int nb_connection)
556556
if (ctx->debug) {
557557
fprintf(stderr, "Invalid IP address: %s\n", ctx_tcp->ip);
558558
}
559-
close(ctx->s);
560-
ctx->s = -1;
559+
close(new_s);
561560
return -1;
562561
}
563562
}

0 commit comments

Comments
 (0)