memory leak?

why nullptr assignment?