Well then why does Valgrind report a memory leak for anon's code?
Code:
$ valgrind --leak-check=full --show-reachable=yes ./sp
==19907== Memcheck, a memory error detector.
==19907== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al.
==19907== Using LibVEX rev 1658, a library for dynamic binary translation.
==19907== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP.
==19907== Using valgrind-3.2.1, a dynamic binary instrumentation framework.
==19907== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al.
==19907== For more details, rerun with: -v
==19907==
666
==19907==
==19907== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 15 from 1)
==19907== malloc/free: in use at exit: 4 bytes in 1 blocks.
==19907== malloc/free: 4 allocs, 3 frees, 113 bytes allocated.
==19907== For counts of detected errors, rerun with: -v
==19907== searching for pointers to 1 not-freed blocks.
==19907== checked 88,204 bytes.
==19907==
==19907== 4 bytes in 1 blocks are definitely lost in loss record 1 of 1
==19907== at 0x4005B65: operator new(unsigned) (vg_replace_malloc.c:163)
==19907== by 0x8048C48: X::X() (in sp)
==19907== by 0x8048A92: main (in sp)
==19907==
==19907== LEAK SUMMARY:
==19907== definitely lost: 4 bytes in 1 blocks.
==19907== possibly lost: 0 bytes in 0 blocks.
==19907== still reachable: 0 bytes in 0 blocks.
==19907== suppressed: 0 bytes in 0 blocks.
$