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