diff options
author | 1997-08-23 10:43:24 +0000 | |
---|---|---|
committer | 1997-08-23 10:43:24 +0000 | |
commit | b58fb9c13afef103fea95b8844e70aa8cebcdbaa (patch) | |
tree | d5f522b3ad1bfda6d0abae05214dad687b60658e /lib/libc/stdlib/malloc.c | |
parent | sync usage() to man (diff) | |
download | wireguard-openbsd-b58fb9c13afef103fea95b8844e70aa8cebcdbaa.tar.xz wireguard-openbsd-b58fb9c13afef103fea95b8844e70aa8cebcdbaa.zip |
Change realloc(foo,0) to behave like malloc(0). Both now return a pointer
to an object of size zero. This will allow testing on reallocs return value
to determine if the operation was successful or not.
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
-rw-r--r-- | lib/libc/stdlib/malloc.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 12cc67083da..66d1a2a9daf 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -8,7 +8,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: malloc.c,v 1.28 1997/08/22 17:06:59 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: malloc.c,v 1.29 1997/08/23 10:43:25 pefo Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -1234,9 +1234,6 @@ realloc(void *ptr, size_t size) } if (!ptr) { r = imalloc(size); - } else if (ptr && !size) { - ifree(ptr); - r = 0; } else { r = irealloc(ptr, size); } |