I'm starting out in C++ and using memcheck to check my programs for memory leaks.
If (when...) there are leaks, I get the Unfreed memory allocations remaining
output, which the uses of new
, malloc
etc which haven't been freed. These are typically accompanied by the source file and line number of the allocation, which makes it easy to fix.
Sometimes though the source module is listed as unknown line:0
, for calls to new
in my case. If memcheck knows a call to new
has been made, how is it that it can't tell where this has come from? I'm just trying to get my head around this so I can have some idea where these leaks might be coming from.