works for me.  Maybe you need to give --leak-check=full?

$ valgrind --leak-check=full ./a.out
 Memcheck, a memory error detector
 Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
 Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info
 Command: ./a.out


 HEAP SUMMARY:
     in use at exit: 1,200 bytes in 3 blocks
   total heap usage: 3 allocs, 0 frees, 1,200 bytes allocated

 400 bytes in 1 blocks are definitely lost in loss record 2 of 3
    at 0x4C246F5: malloc
/tmp/vg/coregrind/m_replacemalloc/vg_replace_malloc.c:195
    by 0x4004A9: main
/data/dkegel/chrome-build/src/tools/valgrind/memcheck/bad.c:7

 400 bytes in 1 blocks are definitely lost in loss record 3 of 3
    at 0x4C246F5: malloc
/tmp/vg/coregrind/m_replacemalloc/vg_replace_malloc.c:195
    by 0x4004B7: main
/data/dkegel/chrome-build/src/tools/valgrind/memcheck/bad.c:9

 LEAK SUMMARY:
    definitely lost: 800 bytes in 2 blocks
    indirectly lost: 0 bytes in 0 blocks
      possibly lost: 0 bytes in 0 blocks
    still reachable: 400 bytes in 1 blocks
         suppressed: 0 bytes in 0 blocks
 Reachable blocks (those to which a pointer was found) are not shown.
 To see them, rerun with: --leak-check=full --show-reachable=yes

 For counts of detected and suppressed errors, rerun with: -v
 ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 5 from 0)

$ valgrind --leak-check=full --show-reachable=yes ./a.out
 Memcheck, a memory error detector
 Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
 Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info
 Command: ./a.out


 HEAP SUMMARY:
     in use at exit: 1,200 bytes in 3 blocks
   total heap usage: 3 allocs, 0 frees, 1,200 bytes allocated

 400 bytes in 1 blocks are still reachable in loss record 1 of 3
    at 0x4C246F5: malloc
/tmp/vg/coregrind/m_replacemalloc/vg_replace_malloc.c:195
    by 0x4004C8: main
/data/dkegel/chrome-build/src/tools/valgrind/memcheck/bad.c:10

 400 bytes in 1 blocks are definitely lost in loss record 2 of 3
    at 0x4C246F5: malloc
/tmp/vg/coregrind/m_replacemalloc/vg_replace_malloc.c:195
    by 0x4004A9: main
/data/dkegel/chrome-build/src/tools/valgrind/memcheck/bad.c:7

 400 bytes in 1 blocks are definitely lost in loss record 3 of 3
    at 0x4C246F5: malloc
/tmp/vg/coregrind/m_replacemalloc/vg_replace_malloc.c:195
    by 0x4004B7: main
/data/dkegel/chrome-build/src/tools/valgrind/memcheck/bad.c:9

 LEAK SUMMARY:
    definitely lost: 800 bytes in 2 blocks
    indirectly lost: 0 bytes in 0 blocks
      possibly lost: 0 bytes in 0 blocks
    still reachable: 400 bytes in 1 blocks
         suppressed: 0 bytes in 0 blocks

 For counts of detected and suppressed errors, rerun with: -v
 ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 5 from 0)

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to