NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/43899: setenv(3)/unsetenv(3) memory leak



In article <20100923131001.5C93F63B995%www.NetBSD.org@localhost>
njoly%pasteur.fr@localhost writes:

> >Description:
> I just noticed that unsetenv(3) does not seems to reclaim memory that was
> allocated by setenv(3) for a single variable.

setenv(3) leaks memory by its nature.  It's a spec.

The problem is that our implementation of putenv(3) leaks memory.
The standard says we can use putenv(3) without memory leaks.
http://www.opengroup.org/onlinepubs/9699919799/functions/putenv.html

Thanks,
-- 
ITOH Yasufumi


Home | Main Index | Thread Index | Old Index