Memory bug fixed
Wolfram Gloger
wmglo@dent.med.uni-muenchen.de
Fri Jul 14 02:11:00 GMT 2000
> 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.
More information about the Libc-hacker
mailing list