From 0f61c82d2e2d4b9f3f53f2ad06b599def6f408e9 Mon Sep 17 00:00:00 2001 From: Or Ozeri Date: Thu, 25 Nov 2021 15:45:00 +0200 Subject: [PATCH] test/librbd: fix memory leak in TestMockParentCacheObjectDispatch fix memory leak in TestMockParentCacheObjectDispatch. Signed-off-by: Or Ozeri --- src/test/librbd/cache/test_mock_ParentCacheObjectDispatch.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); }))); } -- 2.39.5