New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test/librados/snapshots.cc: Fix memory leak #12690
test/librados/snapshots.cc: Fix memory leak #12690
Conversation
Please test this |
1 similar comment
Please test this |
Fix for valgrind reported leak of librados::ObjectWriteOperation heap object. Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
3b30189
to
06d6550
Compare
@@ -157,15 +157,13 @@ TEST_F(LibRadosSnapshotsPP, SnapCreateRemovePP) { | |||
ASSERT_EQ(0, ioctx.remove("foo")); | |||
ASSERT_EQ(0, ioctx.snap_create("snapbar")); | |||
|
|||
librados::ObjectWriteOperation *op = new librados::ObjectWriteOperation(); | |||
std::unique_ptr<librados::ObjectWriteOperation> op(new librados::ObjectWriteOperation()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might want to use make_unique<librados::ObjectWriteOperation>()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tchaikov I can't find any examples existing in the code base?
$ ag --cpp --ignore ./src/boost/* "make_unique"
$
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my bad, it's a c++14 feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh... yes it is. I thought we must have had a "ceph version" for 11.
Fix for valgrind reported leak of librados::ObjectWriteOperation heap
object.
Signed-off-by: Brad Hubbard bhubbard@redhat.com