usr@linuxusr:~/valgrind_test$ valgrind --leak-check=yes ./test.out ==8846== Memcheck, a memory error detector ==8846== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==8846== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info ==8846== Command: ./test.out ==8846== ==8846== Invalid free() / delete / delete[] / realloc() ==8846== at 0x4845D58: free (in /usr/lib/valgrind/vgpreload_memcheck-arm64-linux.so) ==8846== Address 0x49de090 is 0 bytes inside a block of size 4 free'd ==8846== at 0x4845D58: free (in /usr/lib/valgrind/vgpreload_memcheck-arm64-linux.so) ==8846== Block was alloc'd at ==8846== at 0x4844BFC: malloc (in /usr/lib/valgrind/vgpreload_memcheck-arm64-linux.so) ==8846== ==8846== ==8846== HEAP SUMMARY: ==8846== in use at exit: 4 bytes in 1 blocks ==8846== total heap usage: 2 allocs, 2 frees, 8 bytes allocated ==8846== ==8846== 4 bytes in 1 blocks are definitely lost in loss record 1 of 1 ==8846== at 0x4844BFC: malloc (in /usr/lib/valgrind/vgpreload_memcheck-arm64-linux.so) ==8846== ==8846== LEAK SUMMARY: ==8846== definitely lost: 4 bytes in 1 blocks ==8846== indirectly lost: 0 bytes in 0 blocks ==8846== possibly lost: 0 bytes in 0 blocks ==8846== still reachable: 0 bytes in 0 blocks ==8846== suppressed: 0 bytes in 0 blocks ==8846== ==8846== For counts of detected and suppressed errors, rerun with: -v ==8846== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)