Jelajahi Sumber

Fix small leak (64 bytes in TCP) in unit-test-client

Stéphane Raimbault 8 tahun lalu
induk
melakukan
ae500259ec
1 mengubah file dengan 5 tambahan dan 1 penghapusan
  1. 5 1
      tests/unit-test-client.c

+ 5 - 1
tests/unit-test-client.c

@@ -649,11 +649,15 @@ int main(int argc, char *argv[])
     printf("* modbus_read_registers at special address: ");
     ASSERT_TRUE(rc == -1 && errno == EMBXSBUSY, "");
 
-    /** SERVER **/
+    /** Run a few tests to challenge the server code **/
     if (test_server(ctx, use_backend) == -1) {
         goto close;
     }
 
+    modbus_close(ctx);
+    modbus_free(ctx);
+    ctx = NULL;
+
     /* Test init functions */
     printf("\nTEST INVALID INITIALIZATION:\n");
     ctx = modbus_new_rtu(NULL, 1, 'A', 0, 0);