Skip to content

fix #11542: FP memleak when using memcpy() with pointer#6792

Merged
danmar merged 9 commits intocppcheck-opensource:mainfrom
ludviggunne:fix11542
Nov 28, 2024
Merged

fix #11542: FP memleak when using memcpy() with pointer#6792
danmar merged 9 commits intocppcheck-opensource:mainfrom
ludviggunne:fix11542

Conversation

@ludviggunne
Copy link
Copy Markdown
Collaborator

Work in progress.

Just wanted to check if I'm heading in the right direction and using the
internal API correctly.

Is there a way to check if a variable is a pointer to a pointer?

@ludviggunne
Copy link
Copy Markdown
Collaborator Author

Perhaps adding Variable::getIndirectionLevel() would be useful? Shouldn't be too hard to implement.

@chrchr-github
Copy link
Copy Markdown
Collaborator

var->valueType()->pointer should be 2 in this case.

@ludviggunne
Copy link
Copy Markdown
Collaborator Author

var->valueType()->pointer should be 2 in this case.

Good to know!

Comment thread test/testleakautovar.cpp Outdated
Comment thread lib/checkleakautovar.cpp Outdated
Comment thread lib/checkleakautovar.cpp Outdated
@ludviggunne ludviggunne marked this pull request as ready for review October 22, 2024 09:21
Comment thread test/testleakautovar.cpp Outdated
Comment thread lib/checkleakautovar.cpp Outdated
@danmar danmar merged commit 5c54e72 into cppcheck-opensource:main Nov 28, 2024
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.

3 participants