]> git-server-git.apps.pok.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)
committerOr Ozeri <oro@il.ibm.com>
Sun, 28 Nov 2021 11:06:34 +0000 (13:06 +0200)
fix memory leak in TestMockParentCacheObjectDispatch.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
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);
       })));
   }