Skip to content

Commit

Permalink
test: potential memory leak in FlushAioPP
Browse files Browse the repository at this point in the history
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 ada7ec8)
  • Loading branch information
wonzhq authored and Jason Dillaman committed Jul 17, 2015
1 parent a4fc63a commit f99f312
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/test/librbd/test_librbd.cc
Expand Up @@ -1975,12 +1975,12 @@ TEST_F(TestLibRBD, FlushAioPP)
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);
}
Expand Down

0 comments on commit f99f312

Please sign in to comment.