Calling setenv() does a hidden malloc() in order to copy the environment variables from the stack onto the heap where it has space to add more environment variables. We want to avoid that in all paths to handle_connection() so that the execution environment is the same between running locally and as a server.
Calling
setenv()
does a hiddenmalloc()
in order to copy the environment variables from the stack onto the heap where it has space to add more environment variables. We want to avoid that in all paths tohandle_connection()
so that the execution environment is the same between running locally and as a server.