◐ Shell
clean mode source ↗

do not set values if there is no expression by firewave · Pull Request #7295 · cppcheck-opensource/cppcheck

This occurs in e.g. TestAutoVariables::testinvaliddealloc.

The Variable has no mNameToken and points to void* which appears to be the injected parameter for free(). The errorPath in the values seems to support this:

Address of variable taken here.
Calling function 'free', 1st argument '&c2' value is lifetime=c2

Not sure if something with the injecting is lacking data. But I do not think this needs to be solved in the scope of this PR.

@pfultz2 Any thoughts?