What happens with memory leaks AFTER the application ends?
Afaik, there isn't anything in the language standard that talks about what happens to dynamically allocated memory after a program exits. That's left up to the operating system. Modern operating systems implement memory managers that will clean up after dirty programs. It's bad practice to rely on that though.
If you're programming for micro controllers, when there is no memory manager, dynamically allocated memory that isn't freed could be tied up permanently until the unit is rebooted.