cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

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

Open ludviggunne opened this issue 1 year ago • 3 comments

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 avatar Sep 10 '24 08:09 ludviggunne

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

ludviggunne avatar Sep 10 '24 09:09 ludviggunne

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

chrchr-github avatar Sep 10 '24 09:09 chrchr-github

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

Good to know!

ludviggunne avatar Sep 10 '24 09:09 ludviggunne