@@ -1329,6 +1329,8 @@ test_count_read_concern (void)
13291329 mock_server_replies_simple (request , "{ 'n' : 42, 'ok' : 1 } " );
13301330 count = future_get_int64_t (future );
13311331 ASSERT_OR_PRINT (count == 42 , error );
1332+ request_destroy (request );
1333+ future_destroy (future );
13321334
13331335 /* readConcern: { level: majority } */
13341336 rc = mongoc_read_concern_new ();
@@ -1347,7 +1349,8 @@ test_count_read_concern (void)
13471349 count = future_get_int64_t (future );
13481350 ASSERT_OR_PRINT (count == 43 , error );
13491351 mongoc_read_concern_destroy (rc );
1350-
1352+ request_destroy (request );
1353+ future_destroy (future );
13511354
13521355 /* readConcern: { level: local } */
13531356 rc = mongoc_read_concern_new ();
@@ -1366,6 +1369,8 @@ test_count_read_concern (void)
13661369 count = future_get_int64_t (future );
13671370 ASSERT_OR_PRINT (count == 44 , error );
13681371 mongoc_read_concern_destroy (rc );
1372+ request_destroy (request );
1373+ future_destroy (future );
13691374
13701375 /* readConcern: { level: futureCompatible } */
13711376 rc = mongoc_read_concern_new ();
@@ -1384,6 +1389,8 @@ test_count_read_concern (void)
13841389 count = future_get_int64_t (future );
13851390 ASSERT_OR_PRINT (count == 45 , error );
13861391 mongoc_read_concern_destroy (rc );
1392+ request_destroy (request );
1393+ future_destroy (future );
13871394
13881395 /* Setting readConcern to NULL should not send readConcern */
13891396 rc = mongoc_read_concern_new ();
@@ -1402,6 +1409,8 @@ test_count_read_concern (void)
14021409 count = future_get_int64_t (future );
14031410 ASSERT_OR_PRINT (count == 46 , error );
14041411 mongoc_read_concern_destroy (rc );
1412+ request_destroy (request );
1413+ future_destroy (future );
14051414
14061415 /* Fresh read_concern should not send readConcern */
14071416 rc = mongoc_read_concern_new ();
@@ -1418,8 +1427,10 @@ test_count_read_concern (void)
14181427 mock_server_replies_simple (request , "{ 'n' : 47, 'ok' : 1 } " );
14191428 count = future_get_int64_t (future );
14201429 ASSERT_OR_PRINT (count == 47 , error );
1421- mongoc_read_concern_destroy (rc );
14221430
1431+ mongoc_read_concern_destroy (rc );
1432+ request_destroy (request );
1433+ future_destroy (future );
14231434 mongoc_collection_destroy (collection );
14241435 mongoc_client_destroy (client );
14251436 mock_server_destroy (server );
@@ -1708,6 +1719,7 @@ test_aggregate (void)
17081719 ASSERT (!r );
17091720 ASSERT (mongoc_cursor_error (cursor , & error ));
17101721 ASSERT (error .code == 16436 );
1722+ mongoc_cursor_destroy (cursor );
17111723
17121724 for (i = 0 ; i < 2 ; i ++ ) {
17131725 if (i % 2 == 0 ) {
@@ -2721,6 +2733,7 @@ test_find_read_concern (void)
27212733 future_destroy (future );
27222734 request_destroy (request );
27232735 mongoc_cursor_destroy (cursor );
2736+ mongoc_read_concern_destroy (rc );
27242737
27252738 /* readConcernLevel = random */
27262739 rc = mongoc_read_concern_new ();
@@ -2753,6 +2766,7 @@ test_find_read_concern (void)
27532766 future_destroy (future );
27542767 request_destroy (request );
27552768 mongoc_cursor_destroy (cursor );
2769+ mongoc_read_concern_destroy (rc );
27562770
27572771 /* empty readConcernLevel doesn't send anything */
27582772 rc = mongoc_read_concern_new ();
@@ -2782,6 +2796,7 @@ test_find_read_concern (void)
27822796 future_destroy (future );
27832797 request_destroy (request );
27842798 mongoc_cursor_destroy (cursor );
2799+ mongoc_read_concern_destroy (rc );
27852800
27862801 /* readConcernLevel = NULL doesn't send anything */
27872802 rc = mongoc_read_concern_new ();
@@ -2809,10 +2824,11 @@ test_find_read_concern (void)
28092824 " 'ns': 'test.test',"
28102825 " 'firstBatch': [{'_id': 123}]}}" );
28112826 ASSERT (future_get_bool (future ));
2827+
28122828 future_destroy (future );
28132829 request_destroy (request );
28142830 mongoc_cursor_destroy (cursor );
2815-
2831+ mongoc_read_concern_destroy ( rc );
28162832 mongoc_collection_destroy (collection );
28172833 mongoc_client_destroy (client );
28182834 mock_server_destroy (server );
@@ -2919,7 +2935,7 @@ test_aggregate_read_concern (void)
29192935 request_destroy (request );
29202936 future_destroy (future );
29212937
2922-
2938+ mongoc_read_concern_destroy ( rc );
29232939 mongoc_collection_destroy (collection );
29242940 mongoc_client_destroy (client );
29252941 mock_server_destroy (server );
0 commit comments