This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MinGW status for readline


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]