==127171== Memcheck, a memory error detector ==127171== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==127171== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info ==127171== Command: ./double_free ==127171== ==127171== Invalid read of size 1 ==127171== at 0x4006CE: print_string (double_free.c:12) ==127171== by 0x400705: main (double_free.c:19) ==127171== Address 0x5205040 is 0 bytes inside a block of size 4 free'd ==127171== at 0x4C2B06D: free (vg_replace_malloc.c:540) ==127171== by 0x40067D: repeat_char (double_free.c:7) ==127171== by 0x4006F5: main (double_free.c:18) ==127171== Block was alloc'd at ==127171== at 0x4C29F73: malloc (vg_replace_malloc.c:309) ==127171== by 0x400635: repeat_char (double_free.c:2) ==127171== by 0x4006F5: main (double_free.c:18) ==127171== ==127171== Invalid read of size 1 ==127171== at 0x4006AD: print_string (double_free.c:13) ==127171== by 0x400705: main (double_free.c:19) ==127171== Address 0x5205040 is 0 bytes inside a block of size 4 free'd ==127171== at 0x4C2B06D: free (vg_replace_malloc.c:540) ==127171== by 0x40067D: repeat_char (double_free.c:7) ==127171== by 0x4006F5: main (double_free.c:18) ==127171== Block was alloc'd at ==127171== at 0x4C29F73: malloc (vg_replace_malloc.c:309) ==127171== by 0x400635: repeat_char (double_free.c:2) ==127171== by 0x4006F5: main (double_free.c:18) ==127171== ==127171== Invalid free() / delete / delete[] / realloc() ==127171== at 0x4C2B06D: free (vg_replace_malloc.c:540) ==127171== by 0x400711: main (double_free.c:20) ==127171== Address 0x5205040 is 0 bytes inside a block of size 4 free'd ==127171== at 0x4C2B06D: free (vg_replace_malloc.c:540) ==127171== by 0x40067D: repeat_char (double_free.c:7) ==127171== by 0x4006F5: main (double_free.c:18) ==127171== Block was alloc'd at ==127171== at 0x4C29F73: malloc (vg_replace_malloc.c:309) ==127171== by 0x400635: repeat_char (double_free.c:2) ==127171== by 0x4006F5: main (double_free.c:18) ==127171== @@@==127171== ==127171== HEAP SUMMARY: ==127171== in use at exit: 0 bytes in 0 blocks ==127171== total heap usage: 1 allocs, 2 frees, 4 bytes allocated ==127171== ==127171== All heap blocks were freed -- no leaks are possible ==127171== ==127171== For lists of detected and suppressed errors, rerun with: -s ==127171== ERROR SUMMARY: 8 errors from 3 contexts (suppressed: 0 from 0)