www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/10/31/10:40:37

Message-ID: <363B4A8E.A3AEFCF9@gmx.net>
Date: Sat, 31 Oct 1998 16:36:14 -0100
From: Robert Hoehne <robert DOT hoehne AT gmx DOT net>
Organization: none provided
X-Mailer: Mozilla 4.01 [de] (Win95; I)
MIME-Version: 1.0
To: djgpp-workers <djgpp-workers AT delorie DOT com>
Subject: Patch for malloc.c
X-Priority: 3 (Normal)
Reply-To: djgpp-workers AT delorie DOT com

Hi DJ,

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