@@ -1706,7 +1706,7 @@ TEST(BlueFS, test_shared_alloc) {
17061706 size, shared_alloc_unit, " test shared allocator" ),
17071707 shared_alloc_unit);
17081708 shared_alloc.a ->init_add_free (0 , size);
1709-
1709+ auto sg = make_scope_guard ([&shared_alloc] { delete shared_alloc. a ; });
17101710 BlueFS fs (g_ceph_context);
17111711 // DB device is fully utilized
17121712 ASSERT_EQ (0 , fs.add_block_device (BlueFS::BDEV_DB, bdev_db.path , false ));
@@ -1790,6 +1790,7 @@ TEST(BlueFS, test_shared_alloc_sparse) {
17901790 for (uint64_t i = 5 * bluefs_alloc_unit; i < size; i += 2 * main_unit) {
17911791 shared_alloc.a ->init_add_free (i, main_unit);
17921792 }
1793+ auto sg = make_scope_guard ([&shared_alloc] { delete shared_alloc.a ; });
17931794
17941795 BlueFS fs (g_ceph_context);
17951796 ASSERT_EQ (0 , fs.add_block_device (BlueFS::BDEV_DB, bdev_slow.path , false ,
@@ -1866,6 +1867,7 @@ TEST(BlueFS, test_4k_shared_alloc) {
18661867 size, main_unit, " test shared allocator" ),
18671868 main_unit);
18681869 shared_alloc.a ->init_add_free (bluefs_alloc_unit, size - bluefs_alloc_unit);
1870+ auto sg = make_scope_guard ([&shared_alloc] { delete shared_alloc.a ; });
18691871
18701872 BlueFS fs (g_ceph_context);
18711873 ASSERT_EQ (0 , fs.add_block_device (BlueFS::BDEV_DB, bdev_slow.path , false ,
0 commit comments