123456
int main() { char* str = new char(); str = "test"; //delete str; return 0; }
12
g++ main.cpp valgrind --leak-check=yes ./a.out
1234
... ==14600== LEAK SUMMARY: ==14600== definitely lost: 1 bytes in 1 blocks ...