As one of the developers of the static analyzer, I can state that the problem of finding memory leaks is an extremely difficult and sometimes impossible task for SCA. Static analyzers in this area are very weak, and you should not expect much from them. Dynamic analyzers are much more relevant to the search for memory leaks, and if there is a task to find them, then you should consider dynamic rather than static analysis.
Yes, static analyzers can find simple cases of memory leaks. But in practice, you have a memory leak mainly when the code is complex and the memory is free / allocated in different parts of the program. Therefore, static analysis is really not very effective.
user965097
source share