summaryrefslogtreecommitdiff
path: root/libgcompat
diff options
context:
space:
mode:
Diffstat (limited to 'libgcompat')
-rw-r--r--libgcompat/malloc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libgcompat/malloc.c b/libgcompat/malloc.c
index 6c27f35..3f54a06 100644
--- a/libgcompat/malloc.c
+++ b/libgcompat/malloc.c
@@ -64,7 +64,10 @@ alias(__libc_malloc, __malloc);
void *__libc_memalign(size_t align, size_t len)
{
- return memalign(align, len);
+ void *result;
+ if (posix_memalign(&result, align, len) != 0)
+ return NULL;
+ return result;
}
alias(__libc_memalign, __memalign);