It's still unsafe to do this, unless you can be sure that no other code anywhere in the system calls getenv....