This method assigns to environ outside of any lock, meaning that it's automatically unsafe for multi-threaded programs.
For single-threaded programs, if the exec fails, environ will point to memory that has been freed. The documentation gives a false sense of security:
The process may be in a "broken state" if this function returns in error. For example the working directory, environment variables, signal handling settings, various user/group information, or aspects of stdio file descriptors may have changed.
This method assigns to
environoutside of any lock, meaning that it's automatically unsafe for multi-threaded programs.For single-threaded programs, if the
execfails,environwill point to memory that has been freed. The documentation gives a false sense of security: