You have a bug in your program. Probably dereferencing an invalid pointer or freeing memory twice. Debug your program with the standard debugger (stepping through code, placing break points, inspecting variable values, thinking very hard) or valgrind.