Skip to content

Commit 2d9d845

Browse files
committed
Removed a memory leak when the tests would fail due to the ds3 env variables not being set.
1 parent 0cd2018 commit 2d9d845

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/test.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ ds3_client* get_client() {
2525

2626
ds3_error* error = ds3_create_client_from_env(&client);
2727

28-
ds3_client_register_logging(client, INFO, test_log, NULL);
29-
3028
if (error != NULL) {
3129
fprintf(stderr, "Failed to construct ds3_client from enviornment variables: %s\n", error->message->value);
32-
exit(1);
30+
ds3_free_error(error);
31+
BOOST_FAIL("Failed to setup client.");
3332
}
3433

34+
ds3_client_register_logging(client, INFO, test_log, NULL);
35+
3536
return client;
3637
}
3738

0 commit comments

Comments
 (0)