On Fri, Sep 27, 2002 at 04:26:30AM -0400, Glenn Maynard wrote: > That's one problem, but mine was another: you can't modify the static > environment from a prior putenv() call and expect it to change the > environment. (Well, maybe that's what's supposed to happen, but it > wasn't.) Call putenv() each time. (Full patch attached.)
linux man page on putenv clarifies that. It says that glibc 2.0-2.1.1 used a copy of the string to put into environment, which caused memory leak and violated SUSv2; it was fixed in glibc 2.1.2. As a workaround an extra putenv can help, but it does not solve memory leak. -- Alexander.