Skip to content

Commit

Permalink
librados/librados.cc: fix UNINIT issue
Browse files Browse the repository at this point in the history
Fix for issues introduced with cba4ed4:

CID 1256099 (#1 of 1): Uninitialized pointer read (UNINIT)
 uninit_use: Using uninitialized value this->impl.

CID 1256100 (#1 of 1): Uninitialized pointer read (UNINIT)
 uninit_use: Using uninitialized value this->impl.

Don't delete a pointer in the constructor if the pointer
isn't initialized before.

Signed-off-by: Danny Al-Gaaf <[email protected]>
  • Loading branch information
dalgaaf committed Jan 7, 2015
1 parent 5ca4709 commit 8511b55
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/librados/librados.cc
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,6 @@ librados::NObjectIterator::~NObjectIterator()
librados::NObjectIterator::NObjectIterator(const NObjectIterator &rhs)
{
if (rhs.impl == NULL) {
delete impl;
impl = NULL;
return;
}
Expand Down Expand Up @@ -4707,7 +4706,6 @@ librados::ListObject::ListObject(librados::ListObjectImpl *i): impl(i)
librados::ListObject::ListObject(const ListObject& rhs)
{
if (rhs.impl == NULL) {
delete impl;
impl = NULL;
return;
}
Expand Down

0 comments on commit 8511b55

Please sign in to comment.