Mail Archives: djgpp-workers/1999/08/20/18:14:27
Sorry to resend, but I think this is a fairly important bug and I wanted
to make sure the patch got in.
This fixes a reported bug where a realloc() when memory was exhausted
would dereference NULL and otherwise misbehave.
--- src/libc/ansi/stdlib/malloc.c Thu Jun 3 14:13:20 1999
+++ src/libc/ansi/stdlib/malloc.c.new Mon Aug 16 23:58:04 1999
@@ -348,6 +348,8 @@
}
newptr = (char *)malloc(size);
+ if (!newptr)
+ return NULL;
#if DEBUG
printf("realloc %u %u/%08x %08x->%08, %u\n",
size, b->size & ~1, b, ptr, newptr, copysize);
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -