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