www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/10/31/11:36:07

Date: Sat, 31 Oct 1998 11:34:32 -0500 (EST)
Message-Id: <199810311634.LAA05279@indy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp-workers AT delorie DOT com
In-reply-to: <363B4A8E.A3AEFCF9@gmx.net> (message from Robert Hoehne on Sat,
31 Oct 1998 16:36:14 -0100)
Subject: Re: Patch for malloc.c
Reply-To: djgpp-workers AT delorie DOT com

While esthetically better, I don't see how not applying this patch
would ever cause a code fault.

> there is still one patch for malloc.c not applied.
> Here it is again (this is for fixing the bug when
> calling free(NULL); )
> 
> --- src/libc/ansi/stdlib/malloc.c~	Sat Sep 19 18:59:14 1998
> +++ src/libc/ansi/stdlib/malloc.c	Thu Jul 30 18:53:42 1998
> @@ -279,9 +279,10 @@
>  free(void *ptr)
>  {
>    int b;
> -  BLOCK *block = (BLOCK *)((char *)ptr-4);
> +  BLOCK *block;
>    if (ptr == 0)
>      return;
> +  block = (BLOCK *)((char *)ptr-4);
>  
>  #if NUMSMALL
>    if (block->size < SMALL)
> 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019