From owner-freebsd-current@FreeBSD.ORG Mon Oct 16 19:30:49 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6A49016A412 for ; Mon, 16 Oct 2006 19:30:49 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 78DD043E43 for ; Mon, 16 Oct 2006 19:29:24 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k9GJSwcq042084; Mon, 16 Oct 2006 15:29:00 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Peter Jeremy Date: Mon, 16 Oct 2006 15:25:48 -0400 User-Agent: KMail/1.9.1 References: <20061006200320.T1063@baba.farley.org> <200610101001.04286.jhb@freebsd.org> <20061015091244.GC1239@turion.vk2pj.dyndns.org> In-Reply-To: <20061015091244.GC1239@turion.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200610161525.49212.jhb@freebsd.org> Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 16 Oct 2006 15:29:03 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/2037/Mon Oct 16 12:41:42 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: freebsd-current@freebsd.org, "Sean C. Farley" Subject: Re: Fix for memory leak in setenv/unsetenv X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2006 19:30:49 -0000 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