Should call the release function instead of deleting it to free
librbd::RBD::AioCompletion and librbd::AioCompletion. Otherwise there is
a potential memory leak.
Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
(cherry picked from commit
ada7ec860cb7901c560c12a5af36dc7c23051b76)
ASSERT_EQ(0, image.aio_flush(flush_comp));
ASSERT_EQ(0, flush_comp->wait_for_complete());
ASSERT_EQ(1, flush_comp->is_complete());
- delete flush_comp;
+ flush_comp->release();
for (i = 0; i < num_aios; ++i) {
librbd::RBD::AioCompletion *comp = write_comps[i];
ASSERT_EQ(1, comp->is_complete());
- delete comp;
+ comp->release();
}
ASSERT_PASSED(validate_object_map, image);
}