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,11 +649,15 @@ int main(int argc, char *argv[]) | ||
| 649 | printf("* modbus_read_registers at special address: "); | 649 | printf("* modbus_read_registers at special address: "); |
| 650 | ASSERT_TRUE(rc == -1 && errno == EMBXSBUSY, ""); | 650 | ASSERT_TRUE(rc == -1 && errno == EMBXSBUSY, ""); |
| 651 | 651 | ||
| 652 | - /** SERVER **/ | 652 | + /** Run a few tests to challenge the server code **/ |
| 653 | if (test_server(ctx, use_backend) == -1) { | 653 | if (test_server(ctx, use_backend) == -1) { |
| 654 | goto close; | 654 | goto close; |
| 655 | } | 655 | } |
| 656 | 656 | ||
| 657 | + modbus_close(ctx); | ||
| 658 | + modbus_free(ctx); | ||
| 659 | + ctx = NULL; | ||
| 660 | + | ||
| 657 | /* Test init functions */ | 661 | /* Test init functions */ |
| 658 | printf("\nTEST INVALID INITIALIZATION:\n"); | 662 | printf("\nTEST INVALID INITIALIZATION:\n"); |
| 659 | ctx = modbus_new_rtu(NULL, 1, 'A', 0, 0); | 663 | ctx = modbus_new_rtu(NULL, 1, 'A', 0, 0); |