@@ -1329,6 +1329,8 @@ test_count_read_concern (void)
1329
1329
mock_server_replies_simple (request , "{ 'n' : 42, 'ok' : 1 } " );
1330
1330
count = future_get_int64_t (future );
1331
1331
ASSERT_OR_PRINT (count == 42 , error );
1332
+ request_destroy (request );
1333
+ future_destroy (future );
1332
1334
1333
1335
/* readConcern: { level: majority } */
1334
1336
rc = mongoc_read_concern_new ();
@@ -1347,7 +1349,8 @@ test_count_read_concern (void)
1347
1349
count = future_get_int64_t (future );
1348
1350
ASSERT_OR_PRINT (count == 43 , error );
1349
1351
mongoc_read_concern_destroy (rc );
1350
-
1352
+ request_destroy (request );
1353
+ future_destroy (future );
1351
1354
1352
1355
/* readConcern: { level: local } */
1353
1356
rc = mongoc_read_concern_new ();
@@ -1366,6 +1369,8 @@ test_count_read_concern (void)
1366
1369
count = future_get_int64_t (future );
1367
1370
ASSERT_OR_PRINT (count == 44 , error );
1368
1371
mongoc_read_concern_destroy (rc );
1372
+ request_destroy (request );
1373
+ future_destroy (future );
1369
1374
1370
1375
/* readConcern: { level: futureCompatible } */
1371
1376
rc = mongoc_read_concern_new ();
@@ -1384,6 +1389,8 @@ test_count_read_concern (void)
1384
1389
count = future_get_int64_t (future );
1385
1390
ASSERT_OR_PRINT (count == 45 , error );
1386
1391
mongoc_read_concern_destroy (rc );
1392
+ request_destroy (request );
1393
+ future_destroy (future );
1387
1394
1388
1395
/* Setting readConcern to NULL should not send readConcern */
1389
1396
rc = mongoc_read_concern_new ();
@@ -1402,6 +1409,8 @@ test_count_read_concern (void)
1402
1409
count = future_get_int64_t (future );
1403
1410
ASSERT_OR_PRINT (count == 46 , error );
1404
1411
mongoc_read_concern_destroy (rc );
1412
+ request_destroy (request );
1413
+ future_destroy (future );
1405
1414
1406
1415
/* Fresh read_concern should not send readConcern */
1407
1416
rc = mongoc_read_concern_new ();
@@ -1418,8 +1427,10 @@ test_count_read_concern (void)
1418
1427
mock_server_replies_simple (request , "{ 'n' : 47, 'ok' : 1 } " );
1419
1428
count = future_get_int64_t (future );
1420
1429
ASSERT_OR_PRINT (count == 47 , error );
1421
- mongoc_read_concern_destroy (rc );
1422
1430
1431
+ mongoc_read_concern_destroy (rc );
1432
+ request_destroy (request );
1433
+ future_destroy (future );
1423
1434
mongoc_collection_destroy (collection );
1424
1435
mongoc_client_destroy (client );
1425
1436
mock_server_destroy (server );
@@ -1708,6 +1719,7 @@ test_aggregate (void)
1708
1719
ASSERT (!r );
1709
1720
ASSERT (mongoc_cursor_error (cursor , & error ));
1710
1721
ASSERT (error .code == 16436 );
1722
+ mongoc_cursor_destroy (cursor );
1711
1723
1712
1724
for (i = 0 ; i < 2 ; i ++ ) {
1713
1725
if (i % 2 == 0 ) {
@@ -2721,6 +2733,7 @@ test_find_read_concern (void)
2721
2733
future_destroy (future );
2722
2734
request_destroy (request );
2723
2735
mongoc_cursor_destroy (cursor );
2736
+ mongoc_read_concern_destroy (rc );
2724
2737
2725
2738
/* readConcernLevel = random */
2726
2739
rc = mongoc_read_concern_new ();
@@ -2753,6 +2766,7 @@ test_find_read_concern (void)
2753
2766
future_destroy (future );
2754
2767
request_destroy (request );
2755
2768
mongoc_cursor_destroy (cursor );
2769
+ mongoc_read_concern_destroy (rc );
2756
2770
2757
2771
/* empty readConcernLevel doesn't send anything */
2758
2772
rc = mongoc_read_concern_new ();
@@ -2782,6 +2796,7 @@ test_find_read_concern (void)
2782
2796
future_destroy (future );
2783
2797
request_destroy (request );
2784
2798
mongoc_cursor_destroy (cursor );
2799
+ mongoc_read_concern_destroy (rc );
2785
2800
2786
2801
/* readConcernLevel = NULL doesn't send anything */
2787
2802
rc = mongoc_read_concern_new ();
@@ -2809,10 +2824,11 @@ test_find_read_concern (void)
2809
2824
" 'ns': 'test.test',"
2810
2825
" 'firstBatch': [{'_id': 123}]}}" );
2811
2826
ASSERT (future_get_bool (future ));
2827
+
2812
2828
future_destroy (future );
2813
2829
request_destroy (request );
2814
2830
mongoc_cursor_destroy (cursor );
2815
-
2831
+ mongoc_read_concern_destroy ( rc );
2816
2832
mongoc_collection_destroy (collection );
2817
2833
mongoc_client_destroy (client );
2818
2834
mock_server_destroy (server );
@@ -2919,7 +2935,7 @@ test_aggregate_read_concern (void)
2919
2935
request_destroy (request );
2920
2936
future_destroy (future );
2921
2937
2922
-
2938
+ mongoc_read_concern_destroy ( rc );
2923
2939
mongoc_collection_destroy (collection );
2924
2940
mongoc_client_destroy (client );
2925
2941
mock_server_destroy (server );
0 commit comments