I'm having a hard time deallocating memory. using free() on pointers sometimes generate this :
Error in `./runtests': free(): invalid next size (fast): 0x00000000009739e0
This is not confined to unit tests and I do not get this every time I use free(). Some searching tells me that it might be due to a corrupted heap. Can someone give suggestions as to how to locate the source of the problem? From what I've read, the heap corruption line could be anywhere in the program.
P.S : The tests and everything else works fine if I don't free the memory.