@Sh0es: yes your programm has a memory leak as AbstractionAnon described.
Furthermore it would have a memory leak at the end as well but whenever the process exits all space allocated by the process gets delocated
Here is the running code(only added that line of code): http://cpp.sh/4iii