Not looking for you to analyse my debugging session (I'll do that myself), but I'm really curious -- why does malloc call free? Program received signal SIGSEGV, Segmentation fault. 0x00002aaaaac2faab in free () from /lib/libc.so.6 (gdb) bt #0 0x00002aaaaac2faab in free () from /lib/libc.so.6 #1 0x00002aaaaac30cfb in malloc () from /lib/libc.so.6 -- hendrik