$ valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-origins=yes ./read_test ==25496== Memcheck, a memory error detector ==25496== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al. ==25496== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info ==25496== Command: ./read_test ==25496== foo ==25496== Conditional jump or move depends on uninitialised value(s) ==25496== at 0x4EAB5FF: ??? (in /lib/libc-2.14.1.so) ==25496== by 0x4E9354D: fputs (in /lib/libc-2.14.1.so) ==25496== by 0x40066A: main (read_test.c:10) ==25496== Uninitialised value was created by a heap allocation ==25496== at 0x4C2893D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==25496== by 0x4E93EE1: getdelim (in /lib/libc-2.14.1.so) ==25496== by 0x400638: main (read_test.c:8) ==25496== ==25496== Conditional jump or move depends on uninitialised value(s) ==25496== at 0x4E9DBBB: _IO_file_xsputn (in /lib/libc-2.14.1.so) ==25496== by 0x4E935CC: fputs (in /lib/libc-2.14.1.so) ==25496== by 0x40066A: main (read_test.c:10) ==25496== Uninitialised value was created by a heap allocation ==25496== at 0x4C2893D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==25496== by 0x4E93EE1: getdelim (in /lib/libc-2.14.1.so) ==25496== by 0x400638: main (read_test.c:8) ==25496== ==25496== Conditional jump or move depends on uninitialised value(s) ==25496== at 0x4E9DC1F: _IO_file_xsputn (in /lib/libc-2.14.1.so) ==25496== by 0x4E935CC: fputs (in /lib/libc-2.14.1.so) ==25496== by 0x40066A: main (read_test.c:10) ==25496== Uninitialised value was created by a heap allocation ==25496== at 0x4C2893D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==25496== by 0x4E93EE1: getdelim (in /lib/libc-2.14.1.so) ==25496== by 0x400638: main (read_test.c:8) ==25496== ==25496== Conditional jump or move depends on uninitialised value(s) ==25496== at 0x4E9DC28: _IO_file_xsputn (in /lib/libc-2.14.1.so) ==25496== by 0x4E935CC: fputs (in /lib/libc-2.14.1.so) ==25496== by 0x40066A: main (read_test.c:10) ==25496== Uninitialised value was created by a heap allocation ==25496== at 0x4C2893D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==25496== by 0x4E93EE1: getdelim (in /lib/libc-2.14.1.so) ==25496== by 0x400638: main (read_test.c:8) ==25496== ==25496== Conditional jump or move depends on uninitialised value(s) ==25496== at 0x4E9F823: _IO_default_xsputn (in /lib/libc-2.14.1.so) ==25496== by 0x4E9DC39: _IO_file_xsputn (in /lib/libc-2.14.1.so) ==25496== by 0x4E935CC: fputs (in /lib/libc-2.14.1.so) ==25496== by 0x40066A: main (read_test.c:10) ==25496== Uninitialised value was created by a heap allocation ==25496== at 0x4C2893D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==25496== by 0x4E93EE1: getdelim (in /lib/libc-2.14.1.so) ==25496== by 0x400638: main (read_test.c:8) ==25496== ==25496== Conditional jump or move depends on uninitialised value(s) ==25496== at 0x4E9F881: _IO_default_xsputn (in /lib/libc-2.14.1.so) ==25496== by 0x4E9DC39: _IO_file_xsputn (in /lib/libc-2.14.1.so) ==25496== by 0x4E935CC: fputs (in /lib/libc-2.14.1.so) ==25496== by 0x40066A: main (read_test.c:10) ==25496== Uninitialised value was created by a heap allocation ==25496== at 0x4C2893D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==25496== by 0x4E93EE1: getdelim (in /lib/libc-2.14.1.so) ==25496== by 0x400638: main (read_test.c:8) ==25496== ==25496== Use of uninitialised value of size 8 ==25496== at 0x4E9F88B: _IO_default_xsputn (in /lib/libc-2.14.1.so) ==25496== by 0x4E9DC39: _IO_file_xsputn (in /lib/libc-2.14.1.so) ==25496== by 0x4E935CC: fputs (in /lib/libc-2.14.1.so) ==25496== by 0x40066A: main (read_test.c:10) ==25496== Uninitialised value was created by a heap allocation ==25496== at 0x4C2893D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==25496== by 0x4E93EE1: getdelim (in /lib/libc-2.14.1.so) ==25496== by 0x400638: main (read_test.c:8) ==25496== foo ==25496== ==25496== HEAP SUMMARY: ==25496== in use at exit: 0 bytes in 0 blocks ==25496== total heap usage: 1 allocs, 1 frees, 120 bytes allocated ==25496== ==25496== All heap blocks were freed -- no leaks are possible ==25496== ==25496== For counts of detected and suppressed errors, rerun with: -v ==25496== ERROR SUMMARY: 14 errors from 7 contexts (suppressed: 6 from 6)