1 2valgrind output will go to log 3VALGRIND_DO_LEAK_CHECK 44 bytes in 1 blocks are definitely lost in loss record ... of ... 5 by 0x........: doit() (leak_cpp_interior.cpp:89) 6 by 0x........: main (leak_cpp_interior.cpp:104) 7 8LEAK SUMMARY: 9 definitely lost: 4 bytes in 1 blocks 10 indirectly lost: 0 bytes in 0 blocks 11 possibly lost: 0 bytes in 0 blocks 12 still reachable: 111 bytes in 7 blocks 13 of which reachable via heuristic: 14 stdstring : 56 bytes in 2 blocks 15 newarray : 7 bytes in 1 blocks 16 multipleinheritance: 24 bytes in 2 blocks 17 suppressed: 0 bytes in 0 blocks 18Reachable blocks (those to which a pointer was found) are not shown. 19To see them, rerun with: --leak-check=full --show-leak-kinds=all 20 21leak_check summary heuristics multipleinheritance 22LEAK SUMMARY: 23 definitely lost: 4 (+0) bytes in 1 (+0) blocks 24 indirectly lost: 0 (+0) bytes in 0 (+0) blocks 25 possibly lost: 63 (+63) bytes in 3 (+3) blocks 26 still reachable: 48 (-63) bytes in 4 (-3) blocks 27 of which reachable via heuristic: 28 stdstring : 0 (-56) bytes in 0 (-2) blocks 29 newarray : 0 (-7) bytes in 0 (-1) blocks 30 multipleinheritance: 24 (+0) bytes in 2 (+0) blocks 31 suppressed: 0 (+0) bytes in 0 (+0) blocks 32To see details of leaked memory, give 'full' arg to leak_check 33 34leak_check summary any heuristics newarray 35LEAK SUMMARY: 36 definitely lost: 4 (+0) bytes in 1 (+0) blocks 37 indirectly lost: 0 (+0) bytes in 0 (+0) blocks 38 possibly lost: 80 (+17) bytes in 4 (+1) blocks 39 still reachable: 31 (-17) bytes in 3 (-1) blocks 40 of which reachable via heuristic: 41 newarray : 7 (+7) bytes in 1 (+1) blocks 42 multipleinheritance: 0 (-24) bytes in 0 (-2) blocks 43 suppressed: 0 (+0) bytes in 0 (+0) blocks 44To see details of leaked memory, give 'full' arg to leak_check 45 46leak_check summary heuristics stdstring 47LEAK SUMMARY: 48 definitely lost: 4 (+0) bytes in 1 (+0) blocks 49 indirectly lost: 0 (+0) bytes in 0 (+0) blocks 50 possibly lost: 31 (-49) bytes in 3 (-1) blocks 51 still reachable: 80 (+49) bytes in 4 (+1) blocks 52 of which reachable via heuristic: 53 stdstring : 56 (+56) bytes in 2 (+2) blocks 54 newarray : 0 (-7) bytes in 0 (-1) blocks 55 suppressed: 0 (+0) bytes in 0 (+0) blocks 56To see details of leaked memory, give 'full' arg to leak_check 57 58Searching for pointers pointing in 20 bytes from 0x........ 59*0x........ interior points at 4 bytes inside 0x........ 60 Address 0x........ is 0 bytes inside data symbol "ptr" 61block at 0x........ considered reachable by ptr 0x........ using newarray heuristic 62destruct MyClass 63destruct MyClass 64destruct MyClass 65destruct Ce 66destruct Be 67destruct Ae 68destruct Ce 69destruct Be 70destruct Ae 71destruct C 72destruct B 73destruct A 74destruct C 75destruct B 76destruct A 77Finished! 78 79HEAP SUMMARY: 80 in use at exit: 0 bytes in 0 blocks 81 total heap usage: 8 allocs, 8 frees, 115 bytes allocated 82 83All heap blocks were freed -- no leaks are possible 84 85For counts of detected and suppressed errors, rerun with: -v 86ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) 87