summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/malloc/oldmalloc/aligned_alloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/malloc/oldmalloc/aligned_alloc.c b/src/malloc/oldmalloc/aligned_alloc.c
index e06c76ed..4adca3b4 100644
--- a/src/malloc/oldmalloc/aligned_alloc.c
+++ b/src/malloc/oldmalloc/aligned_alloc.c
@@ -12,7 +12,8 @@ void *aligned_alloc(size_t align, size_t len)
return 0;
}
- if (len > SIZE_MAX - align || __malloc_replaced) {
+ if (len > SIZE_MAX - align ||
+ (__malloc_replaced && !__aligned_alloc_replaced)) {
errno = ENOMEM;
return 0;
}