The foregoing does not just cause a memory leak; this causes undefined behavior, which is much, much worse.
The problem is the last three lines:
str2 = str1;
delete [] str2;
delete [] str1;
, , . str2, , str1. str2 , , . , , , str2 str1. undefined . , , !
. , . std::string C-, :
string str1 = "Memory leak";
string str2;
str2 = str1;
, . .