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: Initialize pointer variables in TestMemIoCtxImpl #16785

Merged
merged 1 commit into from Aug 5, 2017

Conversation

amitkumar50
Copy link

Fixes:

1274326 Uninitialized pointer field
2. uninit_member: Non-static class member m_client is not initialized in this constructor nor in any functions that it calls.

CID 1274326 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
4. uninit_member: Non-static class member m_pool is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Amit Kumar amitkuma@redhat.com

TestMemRadosClient *m_client;
TestMemCluster::Pool *m_pool;
TestMemRadosClient *m_client = NULL;
TestMemCluster::Pool *m_pool = NULL;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't find an existing comparison with NULL in the implementation. So better change it to nullptr (introduce now).

@amitkumar50
Copy link
Author

@joscollin Thanks for Comments. Done Changes.

Copy link
Member

@joscollin joscollin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@joscollin joscollin changed the title rados: Initializing uninitialized pointer variables test: Initialize pointer variables in TestMemIoCtxImpl Aug 5, 2017
@joscollin joscollin merged commit 31e6627 into ceph:master Aug 5, 2017
Fixes the coverity issue:

1274326 Uninitialized pointer field
2. uninit_member: Non-static class member m_client is not initialized in
this constructor nor in any functions that it calls.
CID 1274326 (ceph#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
4. uninit_member: Non-static class member m_pool is not initialized in
this constructor nor in any functions that it calls.

Signed-off-by: Amit Kumar amitkuma@redhat.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants