This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, 1.0 has been updated
via cddda5f9beb3d61f1122df95ccfcf855931775b7 (commit)
from 121ee94aa6af104ed33a83bc573739a6f2c02f54 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit cddda5f9beb3d61f1122df95ccfcf855931775b7
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Sun Jan 10 09:08:14 2016 +0100
order of special checks matters
The order of special checks seems critical for some applications.
Xorg 1.18.0 fails to start with XNFreallocarray error.
Took me some time to run with MALLOC_DEBUG=2 to find out.
MALLOC_STANDARD is not affected.
-----------------------------------------------------------------------
Summary of changes:
libc/stdlib/malloc/realloc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libc/stdlib/malloc/realloc.c b/libc/stdlib/malloc/realloc.c
index 8d55289..bdfb526 100644
--- a/libc/stdlib/malloc/realloc.c
+++ b/libc/stdlib/malloc/realloc.c
@@ -26,14 +26,16 @@ realloc (void *mem, size_t new_size)
size_t size;
char *base_mem;
+ if (! mem)
+ return malloc (new_size);
+
/* Check for special cases. */
if (! new_size)
{
free (mem);
return NULL;
}
- if (! mem)
- return malloc (new_size);
+
/* This matches the check in malloc() */
if (unlikely(((unsigned long)new_size > (unsigned long)(MALLOC_HEADER_SIZE*-2))))
return NULL;
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
Show replies by date