diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-05-08 20:20:21 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-05-08 20:20:47 -0500 |
commit | ee849d022bea6bcf7fa2f7747b993034b16096fa (patch) | |
tree | b1f661666796cc6579520b4c35bc592aac2dc8ab | |
parent | 8d59ff51c5d05ece395da3df13dd06821f9154bf (diff) | |
download | gcompat-ee849d022bea6bcf7fa2f7747b993034b16096fa.tar.gz gcompat-ee849d022bea6bcf7fa2f7747b993034b16096fa.tar.bz2 gcompat-ee849d022bea6bcf7fa2f7747b993034b16096fa.tar.xz gcompat-ee849d022bea6bcf7fa2f7747b993034b16096fa.zip |
malloc: use posix_memalign instead of deprecated memalign
-rw-r--r-- | libgcompat/malloc.c | 5 |
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); |