Przeglądaj źródła

Fix wrong close on recent commit 5a6efec

Stéphane Raimbault 2 lat temu
rodzic
commit
46c43ee828
1 zmienionych plików z 1 dodań i 2 usunięć
  1. 1 2
      src/modbus-tcp.c

+ 1 - 2
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;
         }
     }