Skip to content

Commit 99b55d7

Browse files
authored
Fix setting of mongo_crypt_v1 shared library path (#1071)
1 parent df7d545 commit 99b55d7

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/libmongoc/tests/test-mongoc-client-side-encryption.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,19 +2069,22 @@ _reset (mongoc_client_pool_t **pool,
20692069
{
20702070
bson_t *kms_providers;
20712071
mongoc_uri_t *uri;
2072-
bson_t *extra;
20732072
bson_t *schema;
20742073
bson_t *schema_map;
20752074

20762075
mongoc_auto_encryption_opts_destroy (*opts);
20772076
*opts = mongoc_auto_encryption_opts_new ();
2078-
extra = BCON_NEW ("mongocryptdBypassSpawn", BCON_BOOL (true));
2079-
mongoc_auto_encryption_opts_set_extra (*opts, extra);
2080-
char *env_cryptSharedLibPath =
2081-
test_framework_getenv ("MONGOC_TEST_CRYPT_SHARED_LIB_PATH");
2082-
if (env_cryptSharedLibPath) {
2083-
BSON_APPEND_UTF8 (extra, "cryptSharedLibPath", env_cryptSharedLibPath);
2084-
bson_free (env_cryptSharedLibPath);
2077+
{
2078+
bson_t *const extra =
2079+
BCON_NEW ("mongocryptdBypassSpawn", BCON_BOOL (true));
2080+
char *env_cryptSharedLibPath =
2081+
test_framework_getenv ("MONGOC_TEST_CRYPT_SHARED_LIB_PATH");
2082+
if (env_cryptSharedLibPath) {
2083+
BSON_APPEND_UTF8 (extra, "cryptSharedLibPath", env_cryptSharedLibPath);
2084+
bson_free (env_cryptSharedLibPath);
2085+
}
2086+
mongoc_auto_encryption_opts_set_extra (*opts, extra);
2087+
bson_destroy (extra);
20852088
}
20862089
mongoc_auto_encryption_opts_set_keyvault_namespace (*opts, "db", "keyvault");
20872090
kms_providers = _make_kms_providers (false /* aws */, true /* local */);
@@ -2137,7 +2140,6 @@ _reset (mongoc_client_pool_t **pool,
21372140
}
21382141
bson_destroy (schema);
21392142
bson_destroy (schema_map);
2140-
bson_destroy (extra);
21412143
bson_destroy (kms_providers);
21422144
}
21432145

0 commit comments

Comments
 (0)