Why not deallocate it in main in the end in that case? I honestly think that you should always free your resources.

Because deallocation takes time and is useless at the end of the program. It's annoying when you ask an interactive program to exit and it sits there durdling for a while before going away.