From ee849d022bea6bcf7fa2f7747b993034b16096fa Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Wed, 8 May 2019 20:20:21 -0500 Subject: malloc: use posix_memalign instead of deprecated memalign --- libgcompat/malloc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3-70-g09d2