C function which frees a block of memory previously allocated by malloc.

Unfortunately it is rarely called as often as it ought to be leading to memory leaks.

Free() is the C equivalent of the C++ operator delete. It returns memory to the system (see writeup above). It often fills in memory with a special value, such as "f7f7f7f7", "deadbeef", "badf00d" or (whatever the implementation is), so that you can detect in a memory manager / debugger whether or not you have free'd something already. Yet another really good reason to initialize memory before you use it.

Log in or register to write something here or to contact authors.