Skip to content

Fix #14990: FP memleak with function call through function pointer - #8813

Open
aadanen wants to merge 6 commits into
cppcheck-opensource:mainfrom
aadanen:fptr_leak
Open

Fix #14990: FP memleak with function call through function pointer#8813
aadanen wants to merge 6 commits into
cppcheck-opensource:mainfrom
aadanen:fptr_leak

Conversation

@aadanen

@aadanen aadanen commented Aug 27, 2026

Copy link
Copy Markdown

Modify checkleakautovar to consider calls to lambdas and function pointers as function calls that can allow resources to escape the current scope.

@aadanen

aadanen commented Aug 27, 2026

Copy link
Copy Markdown
Author

I am suprised to see all these segmentation faults. In my testing everything seemed to work nicely but I guess it was just crashing silently and working properly. I will need to modify functionCall() more heavily to not send nullptr to the library functions. This kinda undermines my idea of reusing functionCall for anonymous functions but I still think it is better than duplicating the function.

@aadanen

aadanen commented Aug 27, 2026

Copy link
Copy Markdown
Author

I switched from the makefile to cmake and ran the CI workflows locally so I think next time they run, they should pass. Sorry about that. Also I noticed that git was using my work account, so I sorted that out too.

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.

1 participant