Will the snippet of code below cause a memory leak because now my temp points to something else, and the memory block which was allocated for temp will remain on the heap?