Why do I have a memory leak in my c++ code?

Here,

if (Name == "!")
    break;

you are breaking the outter loop, hence exiting the code without closing the file. This will leak memory. You should close the file before the break.