Memory management bugs, in particular incorrect uses of free, are notoriously hard to debug because the symptoms of the problem show up in a place far disconnected from where the bug actually occurred. For instance, an incorrect free can lead to corruption of a completely unrelated object allocated later.
Debugging allocators such as Dmalloc, and tools such as Valgrind and Purify provide some help, by detecting when freed objects are accessed (Valgrind, Purify) or modified (Dmalloc). However, these tools cause large slowdowns, making them unsuitable for anything but debugging, and they still only report problems after the fact (at the bad access) rather than at the bad free itself.
HeapSafe is a C compiler and runtime library that directly check that a program uses free safely, with time and space overheads low enough (normally below 30%) that it can be used all the time. Furthermore, when HeapSafe does detect an invalid free, it can simply leak the object (and log the problem), preventing the program from failing.
HeapSafe is implemented as a C-to-C compiler using gcc as its backend. The currently supported platforms are Linux (debian and RPM packages, source code) and Mac OS X (source code only). HeapSafe does not yet support 64-bit targets.
HeapSafe is available for download from http://ivy.cs.berkeley.edu/heapsafe.
HeapSafe's manual is available in HTML and PDF.
You can sign up for HeapSafe's mailing list at http://maillists.intel-research.net/mailman/listinfo/heapsafe. The list is intended for questions, discussion of HeapSafe-related issues, announcements, etc.
Please send bug reports to the HeapSafe bugs mailing list, at heapsafe-bugs@maillists.intel-research.net