Skip to content
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

Merged

Conversation

badone
Copy link
Contributor

@badone badone commented Dec 28, 2016

Fix for valgrind reported leak of librados::ObjectWriteOperation heap
object.

Signed-off-by: Brad Hubbard bhubbard@redhat.com

@badone
Copy link
Contributor Author

badone commented Dec 29, 2016

Please test this

1 similar comment
@badone
Copy link
Contributor Author

badone commented Dec 29, 2016

Please test this

Fix for valgrind reported leak of librados::ObjectWriteOperation heap
object.

Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
@badone badone force-pushed the wip-ceph_test_rados_api_snapshots-valgrind-fixes branch from 3b30189 to 06d6550 Compare December 29, 2016 03:15
@@ -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());
Copy link
Contributor

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>() .

Copy link
Contributor Author

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"
$

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@badone badone merged commit 988aea4 into ceph:master Jan 4, 2017
@badone badone deleted the wip-ceph_test_rados_api_snapshots-valgrind-fixes branch January 4, 2017 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants