Skip to content

avoid more unchecked pointer dereferences#6293

Merged
chrchr-github merged 1 commit intocppcheck-opensource:mainfrom
firewave:ptr-ref-55
Apr 15, 2024
Merged

avoid more unchecked pointer dereferences#6293
chrchr-github merged 1 commit intocppcheck-opensource:mainfrom
firewave:ptr-ref-55

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread lib/checkleakautovar.cpp
if (var != varInfo.alloctype.end()) {
bool unknown = false;
if (var->second.status == VarInfo::DEALLOC && CheckNullPointer::isPointerDeRef(tok, unknown, mSettings) && !unknown) {
if (var->second.status == VarInfo::DEALLOC && CheckNullPointer::isPointerDeRef(tok, unknown, *mSettings) && !unknown) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Dereferencing those pointers in the check implementations is safe since we know they are never nullptr (and already is done all over the place). This will go away after #5323 is finished.

@chrchr-github chrchr-github merged commit f79424b into cppcheck-opensource:main Apr 15, 2024
@firewave firewave deleted the ptr-ref-55 branch April 15, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants