Skip to content

Fix #14949: FP leakNoVarFunctionCall when passing resource to constructor - #8765

Open
aadanen wants to merge 2 commits into
cppcheck-opensource:mainfrom
aadanen:fix14949
Open

Fix #14949: FP leakNoVarFunctionCall when passing resource to constructor#8765
aadanen wants to merge 2 commits into
cppcheck-opensource:mainfrom
aadanen:fix14949

Conversation

@aadanen

@aadanen aadanen commented Jul 29, 2026

Copy link
Copy Markdown

Remove Variable and AllocType type checking when searching for unreleased arguments and when checking if member variables are deallocated in destructor.

This method is a little heavy handed and might hurt performance, but I am unsure how we could be more precise. It would be nice if we could check "If var.isResource() or var.needsToBeDeallocated()" but that would be a different PR i think.

@aadanen

aadanen commented Jul 29, 2026

Copy link
Copy Markdown
Author

clang-tidy/build fails with
/home/runner/work/cppcheck/cppcheck/lib/checkmemoryleak.cpp:1049:13: error: do not use 'else' after 'continue' [readability-else-after-return,-warnings-as-errors]
1049 | else {
| ^
which will be easy to fix

sanitizers/build fails with a timeout. As I anticipated this solution is too slow. I will think about how to make it faster.

@chrchr-github

chrchr-github commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

sanitizers/build fails with a timeout. As I anticipated this solution is too slow. I will think about how to make it faster.

It does that all the time, I'll rerun it later...

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