When setting environment variables using putenv, you need to keep the string alive until the end of the process, or until the variable is changed. Keep a map to hold this memory chunks alive.
Log in to post a comment.