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

avoid more unchecked pointer dereferences #6293

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

firewave
Copy link
Collaborator

No description provided.

@@ -834,7 +834,7 @@ const Token * CheckLeakAutoVar::checkTokenInsideExpression(const Token * const t
const std::map<int, VarInfo::AllocInfo>::const_iterator var = varInfo.alloctype.find(tok->varId());
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
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 danmar:main Apr 15, 2024
64 checks passed
@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