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

C++: Improve cpp/memory-may-not-be-freed #17110

Merged
merged 3 commits into from
Jul 31, 2024
Merged

C++: Improve cpp/memory-may-not-be-freed #17110

merged 3 commits into from
Jul 31, 2024

Conversation

geoffw0
Copy link
Contributor

@geoffw0 geoffw0 commented Jul 31, 2024

Improve cpp/memory-may-not-be-freed. The query has code that recognizes when a function returns an allocation, i.e. it behaves like an allocator. This code excludes cases where the allocation is copied to a field or global variable in addition to being returned, acknowledging that such cases are probably not allocators / are beyond the scope of analysis by this query. However if the allocation is made into a field, not copied into a field, this was being overlooked (causing large numbers of false positives for some users).

@geoffw0 geoffw0 added the C++ label Jul 31, 2024
@geoffw0 geoffw0 requested a review from a team as a code owner July 31, 2024 13:57
Copy link
Contributor

@MathiasVP MathiasVP left a comment

Choose a reason for hiding this comment

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

The changes LGTM! Since this query isn't part of any suite (yet) it probably isn't relevant to run DCA on it

@geoffw0 geoffw0 merged commit 20672ac into github:main Jul 31, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants