summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/allocator.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/allocator.c b/src/allocator.c
index af6b8a9..1da1ec5 100644
--- a/src/allocator.c
+++ b/src/allocator.c
@@ -60,10 +60,8 @@ zix_default_aligned_alloc(ZixAllocator* const allocator,
#if defined(_WIN32)
return _aligned_malloc(size, alignment);
#elif USE_POSIX_MEMALIGN
- // POSIX.1-2008 TC2 says that ptr is not modified on failure
void* ptr = NULL;
- posix_memalign(&ptr, alignment, size);
- return ptr;
+ return posix_memalign(&ptr, alignment, size) ? NULL : ptr;
#else
return NULL;
#endif