aboutsummaryrefslogtreecommitdiff
path: root/malloc/malloc-check.c
diff options
context:
space:
mode:
Diffstat (limited to 'malloc/malloc-check.c')
-rw-r--r--malloc/malloc-check.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/malloc/malloc-check.c b/malloc/malloc-check.c
index c5265ec..9532316 100644
--- a/malloc/malloc-check.c
+++ b/malloc/malloc-check.c
@@ -111,7 +111,7 @@ mem2chunk_check (void *mem, unsigned char **magic_p)
INTERNAL_SIZE_T sz, c;
unsigned char magic;
- if (!aligned_OK (mem))
+ if (misaligned_mem (mem))
return NULL;
p = mem2chunk (mem);
@@ -275,12 +275,12 @@ realloc_check (void *oldmem, size_t bytes)
malloc_printerr ("realloc(): invalid pointer");
const INTERNAL_SIZE_T oldsize = chunksize (oldp);
- chnb = checked_request2size (rb);
- if (chnb == 0)
+ if (rb > PTRDIFF_MAX)
{
__set_errno (ENOMEM);
goto invert;
}
+ chnb = checked_request2size (rb);
__libc_lock_lock (main_arena.mutex);
@@ -389,7 +389,7 @@ initialize_malloc_check (void)
{
/* This is the copy of the malloc initializer that we pulled in along with
malloc-check. This does not affect any of the libc malloc structures. */
- ptmalloc_init ();
+ __ptmalloc_init ();
TUNABLE_GET (check, int32_t, TUNABLE_CALLBACK (set_mallopt_check));
return __is_malloc_debug_enabled (MALLOC_CHECK_HOOK);
}