Commit ae500259ecb72b51100a6271dba2d50cd91bc351
1 parent
49a2034b
Fix small leak (64 bytes in TCP) in unit-test-client
Showing
1 changed file
with
5 additions
and
1 deletions
tests/unit-test-client.c
| ... | ... | @@ -649,11 +649,15 @@ int main(int argc, char *argv[]) |
| 649 | 649 | printf("* modbus_read_registers at special address: "); |
| 650 | 650 | ASSERT_TRUE(rc == -1 && errno == EMBXSBUSY, ""); |
| 651 | 651 | |
| 652 | - /** SERVER **/ | |
| 652 | + /** Run a few tests to challenge the server code **/ | |
| 653 | 653 | if (test_server(ctx, use_backend) == -1) { |
| 654 | 654 | goto close; |
| 655 | 655 | } |
| 656 | 656 | |
| 657 | + modbus_close(ctx); | |
| 658 | + modbus_free(ctx); | |
| 659 | + ctx = NULL; | |
| 660 | + | |
| 657 | 661 | /* Test init functions */ |
| 658 | 662 | printf("\nTEST INVALID INITIALIZATION:\n"); |
| 659 | 663 | ctx = modbus_new_rtu(NULL, 1, 'A', 0, 0); | ... | ... |