C parent program does some processing and allocates memory, then calls execvp(). What will happen with all the allocated but not freed memory? Is it automatically freed or stays as a garbage?
exec*() replaced the memory of the old process completely with the new program. This includes all allocated memory, so there is no garbage staying behind. But note that other resources like file descriptors are not automatically freed or closed.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more