From: Or Ozeri Date: Thu, 25 Nov 2021 13:45:00 +0000 (+0200) Subject: test/librbd: fix memory leak in TestMockParentCacheObjectDispatch X-Git-Tag: v16.2.8~173^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e1dcc9e73501a07fb666ba6bb12462654d24fb76;p=ceph.git test/librbd: fix memory leak in TestMockParentCacheObjectDispatch fix memory leak in TestMockParentCacheObjectDispatch. Signed-off-by: Or Ozeri (cherry picked from commit 0f61c82d2e2d4b9f3f53f2ad06b599def6f408e9) --- diff --git a/src/test/librbd/cache/test_mock_ParentCacheObjectDispatch.cc b/src/test/librbd/cache/test_mock_ParentCacheObjectDispatch.cc index 2b262825127..05e56f52066 100644 --- a/src/test/librbd/cache/test_mock_ParentCacheObjectDispatch.cc +++ b/src/test/librbd/cache/test_mock_ParentCacheObjectDispatch.cc @@ -107,8 +107,8 @@ public : EXPECT_CALL(*(mparent_image_cache.get_cache_client()), lookup_object(_, _, _, _, _, _)) .WillOnce(WithArg<5>(Invoke([cache_path](CacheGenContextURef on_finish) { - auto ack = new ObjectCacheReadReplyData(RBDSC_READ_REPLY, 0, cache_path); - on_finish.release()->complete(ack); + ObjectCacheReadReplyData ack(RBDSC_READ_REPLY, 0, cache_path); + on_finish.release()->complete(&ack); }))); }