Replacing existing.potential memory leak

This was answered several time on the forum. For instance here.

Search for “potential memory leak”