]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librbd: fix memory leak in TestMockParentCacheObjectDispatch
authorOr Ozeri <oro@il.ibm.com>
Thu, 25 Nov 2021 13:45:00 +0000 (15:45 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Sun, 13 Feb 2022 15:49:58 +0000 (16:49 +0100)
fix memory leak in TestMockParentCacheObjectDispatch.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
(cherry picked from commit 0f61c82d2e2d4b9f3f53f2ad06b599def6f408e9)

src/test/librbd/cache/test_mock_ParentCacheObjectDispatch.cc

index 2b26282512728927a2a6476db0b949bbd1f23cb8..05e56f52066eb05657ccce03a694702547e9892e 100644 (file)
@@ -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);
       })));
   }