Skip to content

CDRIVER-3008 fix possible leak in run_json_general_test #1347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,12 @@ Specification tests may be filtered by their description:

* `MONGOC_JSON_SUBTEST=<string>`

This can be useful in debugging a specific test case in a spec test file with multiple tests.
This can be useful in debugging a specific test case in a spec test file with multiple tests. Example:

```sh
MONGOC_JSON_SUBTEST="Insert with randomized encryption, then find it" \
./cmake-build/src/libmongoc/test-libmongoc -l "/client_side_encryption/legacy/basic"
```

To test with a declared API version, you can pass the API version using an environment variable:

Expand Down
3 changes: 1 addition & 2 deletions src/libmongoc/tests/json-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1824,6 +1824,7 @@ run_json_general_test (const json_test_config_t *config)
bson_free (selected_test);
continue;
}
bson_free (selected_test);

if (bson_has_field (&test, "skipReason")) {
fprintf (stderr,
Expand Down Expand Up @@ -1862,8 +1863,6 @@ run_json_general_test (const json_test_config_t *config)
}
}

bson_free (selected_test);

uri = (config->uri_str != NULL) ? mongoc_uri_new (config->uri_str)
: test_framework_get_uri ();

Expand Down