I am taking a system programming class. The professor mentioned that in the case of returning EXIT_FAILURE, it is not necessary to free the memory allocated in the heap, because the will get reclaimed by the OS.
So my question is, in the case of returning EXIT_SUCCESS, does it live indefinitely? If not, what is the point of freeing the memory after your program terminates?