$ valgrind --leak-check=yes ./overflow -n -1 ==26229== Memcheck, a memory error detector. ==26229== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al. ==26229== Using LibVEX rev 1732, a library for dynamic binary translation. ==26229== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP. ==26229== Using valgrind-3.2.3, a dynamic binary instrumentation framework. ==26229== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al. ==26229== For more details, rerun with: -v ==26229== ==26229== Use of uninitialised value of size 8 ==26229== at 0x4E6880B: (within /lib64/libc-2.6.1.so) ==26229== by 0x4E6B134: vfprintf (in /lib64/libc-2.6.1.so) ==26229== by 0x4E72509: printf (in /lib64/libc-2.6.1.so) ==26229== by 0x4007C2: main (overflow.c:31) ==26229== ==26229== Conditional jump or move depends on uninitialised value(s) ==26229== at 0x4E68815: (within /lib64/libc-2.6.1.so) ==26229== by 0x4E6B134: vfprintf (in /lib64/libc-2.6.1.so) ==26229== by 0x4E72509: printf (in /lib64/libc-2.6.1.so) ==26229== by 0x4007C2: main (overflow.c:31) ==26229== ==26229== Conditional jump or move depends on uninitialised value(s) ==26229== at 0x4E6B1B1: vfprintf (in /lib64/libc-2.6.1.so) ==26229== by 0x4E72509: printf (in /lib64/libc-2.6.1.so) ==26229== by 0x4007C2: main (overflow.c:31) array[-1] = 0 ==26229== ==26229== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 2 from 1) ==26229== malloc/free: in use at exit: 0 bytes in 0 blocks. ==26229== malloc/free: 0 allocs, 0 frees, 0 bytes allocated. ==26229== For counts of detected errors, rerun with: -v ==26229== All heap blocks were freed -- no leaks are possible.