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


>>>>> Wolfram Gloger writes:

>> 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.

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

I've added my patch but didn't add the mtrace.pl change since Uli
commited last night:

        * malloc/mtrace.c (tr_freehook): Return immediately if ptr is NULL.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de

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