Re: Fix for memory leak in setenv/unsetenv

From: John Baldwin <jhb_at_freebsd.org>
Date: Mon, 16 Oct 2006 15:25:48 -0400
On Sunday 15 October 2006 05:12, Peter Jeremy wrote:
> On Tue, 2006-Oct-10 10:01:03 -0400, John Baldwin wrote:
> >I know for one app at my last job we had a problem with this with TZ, and 
so
> >we explicitly space padded the timezone name out to a fixed-size each time
> >to avoid the leak.
> 
> Funny, it was a problem with TZ that led me to raise the PR initially.
> I think I came up with the same work-around.

Heh.

> It's a pity that there's no truely re-entrant interface to the
> ctime(3) family (ie, one that allows you to specify the timezone as
> a parameter).

Yes. :(  That is the real hack I think, having to modify the environment to 
make ctime() DTRT.

-- 
John Baldwin
Received on Mon Oct 16 2006 - 17:30:49 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:01 UTC