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
merged 1 commit into from Jan 4, 2017

Conversation

Projects
None yet
2 participants
@badone
Contributor

badone commented Dec 28, 2016

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

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

@badone

This comment has been minimized.

Contributor

badone commented Dec 29, 2016

Please test this

1 similar comment
@badone

This comment has been minimized.

Contributor

badone commented Dec 29, 2016

Please test this

test/librados/snapshots.cc: Fix memory leak
Fix for valgrind reported leak of librados::ObjectWriteOperation heap
object.

Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
@@ -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());

This comment has been minimized.

@tchaikov

tchaikov Jan 3, 2017

Contributor

might want to use make_unique<librados::ObjectWriteOperation>() .

This comment has been minimized.

@badone

badone Jan 3, 2017

Contributor

@tchaikov I can't find any examples existing in the code base?

$ ag --cpp --ignore ./src/boost/* "make_unique"
$

This comment has been minimized.

@tchaikov

tchaikov Jan 4, 2017

Contributor

my bad, it's a c++14 feature.

This comment has been minimized.

@badone

badone Jan 4, 2017

Contributor

Ahh... yes it is. I thought we must have had a "ceph version" for 11.

@tchaikov tchaikov removed the needs-review label Jan 4, 2017

@badone badone merged commit 988aea4 into ceph:master Jan 4, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details

@badone badone deleted the badone:wip-ceph_test_rados_api_snapshots-valgrind-fixes branch Jan 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment