Skip to content

Commit

Permalink
RadosStriperImpl.cc: fix double free
Browse files Browse the repository at this point in the history
Some variables have been already free'd by calling
release(), no need to call delete() again on them.

CID 1396200 (#1 of 1): Double free (USE_AFTER_FREE)
 double_free: Calling operator delete frees pointer
 getxattr_completion which has already been freed.
CID 1396206 (#1 of 1): Double free (USE_AFTER_FREE)
 double_free: Calling operator delete frees pointer
 getxattr_completion which has already been freed.
CID 1396214 (#1 of 1): Double free (USE_AFTER_FREE)
 double_free: Calling operator delete frees pointer
 stat_completion which has already been freed.
CID 1396218 (#1 of 1): Double free (USE_AFTER_FREE)
 double_free: Calling operator delete frees pointer
 stat_completion which has already been freed.

Signed-off-by: Danny Al-Gaaf <[email protected]>
  • Loading branch information
dalgaaf authored and liewegas committed Feb 9, 2017
1 parent ea34ee5 commit ce5493c
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/libradosstriper/RadosStriperImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,6 @@ int libradosstriper::RadosStriperImpl::aio_generic_stat
// nothing is really started so cancel everything
delete multi_completion;
delete cdata;
delete stat_completion;
return rc;
}
// use a regular AioCompletion for the getxattr async call
Expand All @@ -692,7 +691,6 @@ int libradosstriper::RadosStriperImpl::aio_generic_stat
// the async stat is ongoing, so we need to go on
// we mark the getxattr as failed in the data object
cdata->m_getxattrRC = rc;
delete getxattr_completion;
multi_completion->complete_request(rc);
multi_completion->put();
return rc;
Expand Down

0 comments on commit ce5493c

Please sign in to comment.