aboutsummaryrefslogtreecommitdiffstats
path: root/src/serd_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/serd_internal.h')
-rw-r--r--src/serd_internal.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/serd_internal.h b/src/serd_internal.h
index 67e47e95..3a43dd29 100644
--- a/src/serd_internal.h
+++ b/src/serd_internal.h
@@ -67,8 +67,8 @@ serd_bufalloc(size_t size)
{
#ifdef HAVE_POSIX_MEMALIGN
void* ptr;
- posix_memalign(&ptr, SERD_PAGE_SIZE, size);
- return ptr;
+ const int ret = posix_memalign(&ptr, SERD_PAGE_SIZE, size);
+ return ret ? NULL : ptr;
#else
return malloc(size);
#endif