From: Or Ozeri Date: Thu, 25 Nov 2021 17:52:48 +0000 (+0200) Subject: test/librbd: fix memory leak in TestMockCryptoLoadRequest X-Git-Tag: v16.2.8~173^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9321f25d53029239908237708cbea088602b9df7;p=ceph.git test/librbd: fix memory leak in TestMockCryptoLoadRequest fix memory leak in TestMockCryptoLoadRequest.CryptoAlreadyLoaded Signed-off-by: Or Ozeri (cherry picked from commit 23bb3e458cbcad684bdd62c5ccbea6ce4c3e9cf5) --- diff --git a/src/test/librbd/crypto/test_mock_LoadRequest.cc b/src/test/librbd/crypto/test_mock_LoadRequest.cc index ddf57d26de74..f87d4eea2d40 100644 --- a/src/test/librbd/crypto/test_mock_LoadRequest.cc +++ b/src/test/librbd/crypto/test_mock_LoadRequest.cc @@ -89,7 +89,7 @@ struct TestMockCryptoLoadRequest : public TestMockFixture { }; TEST_F(TestMockCryptoLoadRequest, CryptoAlreadyLoaded) { - mock_image_ctx->crypto = new MockCryptoInterface(); + mock_image_ctx->crypto = crypto; mock_load_request->send(); ASSERT_EQ(-EEXIST, finished_cond.wait()); }