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

misc: SCA and Coverity Fixes #13208

Merged
merged 16 commits into from Feb 9, 2017

Conversation

Projects
None yet
2 participants
@dalgaaf
Member

dalgaaf commented Jan 31, 2017

No description provided.

dalgaaf added some commits Jan 31, 2017

cls/rgw/cls_rgw.cc: prefer ++operator for non-primitive iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
kv/MemDB.cc: prefer ++operator for non-primitive iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_token.h: remove redundant and slow call to c_str()
Do not call c_str() if the parameter is already of type string.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_lc.cc: prefer ++operator for non-primitive iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mds/Mantle.cc: prefer ++operator for non-primitive iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mon/OSDMonitor.cc: prefer ++operator for non-primitive iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
RDMAConnectedSocketImpl.cc: prefer ++operator for non-primitive itera…
…tors

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_torrent.cc: prefer ++operator for non-primitive iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_common.cc: prefer ++operator for non-primitive iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_compression.cc: prefer ++operator for non-primitive iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_main.cc: reorder framework detection
Fix for:

CID 1398896: Resource leak (RESOURCE_LEAK)
 overwrite_var: Overwriting fe in fe = new
 RGWLoadGenFrontend(env, config) leaks the storage that fe
 points to.

Do not check again and again for framework if there is
already a match, make use of if/else. This should also
fix the RESOURCE_LEAK warning.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_rados.cc: prefer ++operator for non-primitive iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_main.cc: close leak in error case
ID 1398895 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable config going out of scope leaks
 the storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
common/Checksummer.h: close resource leak
CID 1395784 (#2-1 of 2): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable state going out of scope
 leaks the storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
osdc/ObjectCacher.cc: fix wrong self assignment
Fix for:

CID 1395468 (#1 of 1): Self assignment (NO_EFFECT)
self_assign: Assigning bh->last_write to itself has no effect.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
RadosStriperImpl.cc: fix double free
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 <danny.al-gaaf@bisect.de>
@liewegas

This comment has been minimized.

Member

liewegas commented Feb 9, 2017

@liewegas liewegas changed the title from SCA and Coverity Fixes to misc: SCA and Coverity Fixes Feb 9, 2017

@liewegas liewegas merged commit 3af6e99 into master Feb 9, 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

@liewegas liewegas deleted the wip-dalgaaf-sca-20170131 branch Feb 9, 2017

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