==2292== HEAP SUMMARY:
==2292== in use at exit: 0 bytes in 0 blocks
==2292== total heap usage: 11,384 allocs, 11,341 frees, 270,935,685 bytes allocated
==2292==
==2292== All heap blocks were freed -- no leaks are possible
More allocs than frees but no leaks?
Name:
Anonymous2012-01-01 21:02
This could be possible if the code does malloc(0) or if some allocations fail (return NULL) but Valgrind still reports them.
Name:
Anonymous2012-01-01 21:10
there are no malloc(0) so i guess it's the second one.. I'm in my ram limit, i guess its getting some NULLs.
Thank ya!
Name:
Anonymous2012-01-01 21:41
What about calling free() twice on pointers?
Not a bad bug, just a bug you never hear about.
>>6
It optimizes anyway any free calls near the end of a program since it knows it'll be returning to the OS anyway which will free any remaining memory
>>13
Why not? It is in my understanding the realloc is likely to allocate but unlikely to call free, and only calls free after a successful allocation.