How can I get valgrind to tell me the address of each non-freed block of memory?

Posted by James on Stack Overflow See other posts from Stack Overflow or by James
Published on 2009-10-08T19:57:46Z Indexed on 2010/03/26 17:03 UTC
Read the original article Hit count: 244

Filed under:
|

Valgrind tells me function xxx allocated memory which was not freed. Fine. It's proving more difficult than usual to trace however.

To this end I have created numerous:

#ifdef DEBUG
fprintf(stderr, "something happening:%lx\n", (unsigned long)ptr);
#endif

So I just need to match these ptr addresses that are displayed with the addresses of non-freed memory.

How can I get valgrind to tell me the address of each non-freed block of memory?

© Stack Overflow or respective owner

Related posts about valgrind

Related posts about memory-leaks