If there are zero unfree'ed memory blocks at program end then your program does not have any memory leak whatever you own measuring routine tells.
That depends on your definition of a memory leak. In the strictest sense (a block without reference in the program outside the heapmanager), it might be.
But if something gets added to some global resource that is freed on shutdown, you get all behaviour of a program with a memleak, without the heaptrc leaks to prove it.
Examples that I found out to my shame:
- memo's used for logging that due to circumstances got fuller than expected
- in a web framework that we used, some resource was not freed from some list, but that list was freed on shutdown.
- Several cases with queues that were not drained by their consumers as intended (in various circumstances) but all were deallocated happily on shutdown.
Basically having excess references where you don't expect them is the same as a memleak.