소스 검색

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

Stéphane Raimbault 9 년 전
부모
커밋
ae500259ec
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  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);