Hi, You can't fix this leak; putenv doesn't copy the string. There should be a comment in the code about this, if not, a good patch would be to add one. This is just a bug in the putenv() API design, which is why setenv and unsetenv are preferred. Havoc