...
C99 states that, "the set of environment names and the method for altering the environment list are implementation-defined." It is consequently important to understand what local functions are available for clearing, modifying, and looking up default values for environment variables. Because some programs may behave in unexpected ways when certain environment variables are not set, it is important to understand which variables are necessary on your system and what are safe values for them.
The non-standard function clearenv(clearenv() function (which is not defined by either C99 or POSIX) may be used to clear out the environment where available, otherwise it can be cleared by obtaining a list of environment variable names from environ and removing each one using unsetenv().
...