summaryrefslogtreecommitdiff
path: root/malloc/hooks.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-01-27 18:32:36 +0000
committerUlrich Drepper <drepper@redhat.com>2003-01-27 18:32:36 +0000
commit371a11f3d732a2025f026e9a2a09567301dc7bae (patch)
tree6ff3bbd08077d402ccb15ac8c34d5da86089c24b /malloc/hooks.c
parent251c0f710cafc3f161fb97c9a270730668428f68 (diff)
downloadglibc-371a11f3d732a2025f026e9a2a09567301dc7bae.tar.gz
(mem2chunk_check): Check alignment of mem pointer, not of the computed chunk.
Diffstat (limited to 'malloc/hooks.c')
-rw-r--r--malloc/hooks.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/malloc/hooks.c b/malloc/hooks.c
index 0bd3e2a9ca..cf6642c930 100644
--- a/malloc/hooks.c
+++ b/malloc/hooks.c
@@ -1,5 +1,5 @@
/* Malloc implementation for multiple threads without lock contention.
- Copyright (C) 2001,02 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Wolfram Gloger <wg@malloc.de>, 2001.
@@ -162,8 +162,8 @@ mem2chunk_check(mem) Void_t* mem;
INTERNAL_SIZE_T sz, c;
unsigned char magic;
+ if(!aligned_OK(mem)) return NULL;
p = mem2chunk(mem);
- if(!aligned_OK(p)) return NULL;
if( (char*)p>=mp_.sbrk_base &&
(char*)p<(mp_.sbrk_base+main_arena.system_mem) ) {
/* Must be a chunk in conventional heap memory. */