I would use a class with a destructor to solve the first issue in a more convenient way.
I don't know about getenv. I would useĀ GetEnvVar and not have the second issue.
I don't know about getenv. I would useĀ GetEnvVar and not have the second issue.