This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

Re: Memory bug fixed


> From: Andreas Jaeger <aj@suse.de>
> 
> >>>>> Ulrich Drepper writes:
> 
> Uli> Andreas Jaeger <aj@suse.de> writes:
> >> Shall I revert the patch and change fgetspent.c also?  Should we teach
> >> mtrace to not emit an error message for free(0) ?
> 
> Uli> Yes and yes.
> 
> Here's a patch.  Is this one ok?
> 
> Andreas
> 
> 2000-07-13  Andreas Jaeger  <aj@suse.de>
> 
> 	* malloc/mtrace.pl (location): Ignore free(0).
> 
> 	* sysdeps/unix/sysv/linux/getsysstats.c (free_mem): Revert last
> 	patch.
> 
> 	* grp/fgetgrent.c (free_mem): Remove if - free (0) is valid.

Just to add my 2 cents -- this is exactly the right approach.  Keep in
mind that free(0) extends to C++, and `delete p' with p==0 is even
more common than in C.  Memory debuggers should always ignore it, at
the very least there needs to be a switch in them defaulting to `off'
WRT to checking for free(0) explicitly.

Regards,
Wolfram.

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