Valgrind & ccmalloc are reporting that there is a memory leak with this:
Valgrind says:
==26081==
==26081== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==26081== malloc/free: in use at exit: 116 bytes in 1 blocks.
==26081== malloc/free: 1 allocs, 0 frees, 116 bytes allocated.
==26081== For a detailed leak analysis, rerun with: --leak-check=yes
==26081== For counts of detected errors, rerun with: -
ccmalloc says:
.---------------.
|ccmalloc report|
=======================================================
| total # of| allocated | deallocated | garbage |
+-----------+-------------+-------------+-------------+
| bytes| 116 | 0 | 116 |
+-----------+-------------+-------------+-------------+
|allocations| 1 | 0 | 1 |
+-----------------------------------------------------+
how can there be a memory leak when no allocations are made?
Code:
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
cout << "Hello World\n";
return 0;
}
Valgrind says:
==26081==
==26081== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==26081== malloc/free: in use at exit: 116 bytes in 1 blocks.
==26081== malloc/free: 1 allocs, 0 frees, 116 bytes allocated.
==26081== For a detailed leak analysis, rerun with: --leak-check=yes
==26081== For counts of detected errors, rerun with: -
ccmalloc says:
.---------------.
|ccmalloc report|
=======================================================
| total # of| allocated | deallocated | garbage |
+-----------+-------------+-------------+-------------+
| bytes| 116 | 0 | 116 |
+-----------+-------------+-------------+-------------+
|allocations| 1 | 0 | 1 |
+-----------------------------------------------------+
how can there be a memory leak when no allocations are made?