From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13693 invoked by alias); 11 Apr 2006 15:05:09 -0000 Received: (qmail 13685 invoked by uid 22791); 11 Apr 2006 15:05:08 -0000 X-Spam-Check-By: sourceware.org Received: from mpv1.TIS.CWRU.Edu (HELO mpv1.tis.cwru.edu) (129.22.105.36) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 11 Apr 2006 15:05:06 +0000 Received: from [129.22.8.211] (caleb.INS.CWRU.Edu [129.22.8.211]) by mpv1.tis.cwru.edu (MOS 3.7.4b-GA) with ESMTP id ASH44684 (AUTH cpr); Tue, 11 Apr 2006 11:05:03 -0400 (EDT) Message-ID: <443BC59F.7040805@case.edu> Date: Tue, 11 Apr 2006 15:31:00 -0000 From: Chet Ramey Reply-To: chet.ramey@case.edu User-Agent: Thunderbird 1.5 (Macintosh/20051201) MIME-Version: 1.0 To: bug-readline@gnu.org, gdb@sourceware.org CC: chet@case.edu Subject: Re: MinGW status for readline References: <20060407200149.GA28248@nevyn.them.org> <443BB2CA.20200@case.edu> <20060411135550.GA22588@nevyn.them.org> <443BB9EB.2040701@case.edu> <20060411144053.GA27577@nevyn.them.org> In-Reply-To: <20060411144053.GA27577@nevyn.them.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00138.txt.bz2 Daniel Jacobowitz wrote: > On Tue, Apr 11, 2006 at 10:15:07AM -0400, Chet Ramey wrote: >> No, you never free username. isolate_tilde_prefix allocates memory >> whether you have the getpwent family available or not. > > It should be? user_entry = 0, so the other branch of the if is taken. ? `username' is assigned before user_entry is. It really should be freed outside the if-then block, now that I'm looking at it. >> (I call endpwent() because its sole usual purpose is to close any open >> file descriptors on the password database, whatever it is. getpwent >> and getpwnam usually keep the database open.) > > Oh, huh. So much for useful man pages. The BSD man pages, at least, say The endpwent() function closes any open files. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ( ``Discere est Dolere'' -- chet ) Live Strong. No day but today. Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/