Valgrind results are clean, but with more allocation than frees

I get this result from Valgrind:

==24810== HEAP SUMMARY: ==24810== in use at exit: 0 bytes in 0 blocks ==24810== total heap usage: 9 allocs, 6 frees, 0 bytes allocated ==24810== ==24810== LEAK SUMMARY: ==24810== definitely lost: 0 bytes in 0 blocks ==24810== indirectly lost: 0 bytes in 0 blocks ==24810== possibly lost: 0 bytes in 0 blocks ==24810== still reachable: 0 bytes in 0 blocks ==24810== suppressed: 0 bytes in 0 blocks 

It says that there was no memory leak. It looks like a good result. But, what about these 9 distributions, 6 free? It seems like I'm not free somewhere. I checked the code, and there are 3 global constant pointers. Maybe they were not considered errors, but printed as not free?

Should I worry about this, or should I assume that the code is not working? Thank you all. .... Just trying to understand everything related to ANSI C with pointers and memory allocations :)))

dictum

+4
source share
1 answer

on the valgrind website http://valgrind.org/docs/manual/quick-start.html#quick-start.interpret

"definitely lost": your memory leak program - fix it!

"possibly lost": your memory leak program if you do not do funny things with pointers (for example, moving them to the middle of a heap block).

So, for your case, your program should be good.

0
source

All Articles