Commit 46c43ee828be268651c441475d9b6cd441576644

Authored by Stéphane Raimbault
1 parent 92dca473

Fix wrong close on recent commit 5a6efec

Showing 1 changed file with 1 additions and 2 deletions
src/modbus-tcp.c
@@ -556,8 +556,7 @@ int modbus_tcp_listen(modbus_t *ctx, int nb_connection) @@ -556,8 +556,7 @@ int modbus_tcp_listen(modbus_t *ctx, int nb_connection)
556 if (ctx->debug) { 556 if (ctx->debug) {
557 fprintf(stderr, "Invalid IP address: %s\n", ctx_tcp->ip); 557 fprintf(stderr, "Invalid IP address: %s\n", ctx_tcp->ip);
558 } 558 }
559 - close(ctx->s);  
560 - ctx->s = -1; 559 + close(new_s);
561 return -1; 560 return -1;
562 } 561 }
563 } 562 }