What is wrong with this code

https://docs.google.com/document/d/1...l=en_US&pli=1#

errors are here

https://docs.google.com/document/d/1...edit?hl=en_US#

As i have studied new pointer are did not destroyed in the that function till you did not delete that or that program did not ends but if it is so then why it is complaining for these errors?
Thanks to all answerers.