Hi every guru, could you please recommend some tools for C++ static
analysis and memory leak detecting.
It will be better if they are free of charge
Most simple is perhaps to compile your code with different compilers
to get various diagnostics. Also there are several open source tools
like cppcheck, oink and flawfinder, but these are usually platform
specific and often produce false alerts.
MS prefast is perhaps best that is "free", but it is closed source,
windows specific and integrated into MS compiler. It is "free" since
for example their free driver development kit has such compiler in it
and you can get it to compile your (likely non-driver) code. Buying a
Visual Studio that features compiler with static analysis is not cheap
(nor "professional").
Then there is option to get AST out from compilers like g++ or CLang
and make analyzing queries yourself based on that. It is not little
work.
If you have budget for statical analysis then you can of course buy a
tool. Most commercial static code analysis tools for C++ are pretty
expensive with prices ranging $1 000 to $10 000 per license.