aboutsummaryrefslogtreecommitdiffstats
path: root/src/serd_internal.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-02-03 20:08:16 +0000
committerDavid Robillard <d@drobilla.net>2013-02-03 20:08:16 +0000
commit541c97ad49dd8bb33297a14f422299328b7f4131 (patch)
tree0cdc5c190af3d753f8b53499044ad056d2014820 /src/serd_internal.h
parent2de072c67cdd39c45abf452b7c3a7ce73004370f (diff)
downloadserd-541c97ad49dd8bb33297a14f422299328b7f4131.tar.gz
serd-541c97ad49dd8bb33297a14f422299328b7f4131.tar.bz2
serd-541c97ad49dd8bb33297a14f422299328b7f4131.zip
Correctly handle posix_memalign failure
git-svn-id: http://svn.drobilla.net/serd/trunk@411 490d8e77-9747-427b-9fa3-0b8f29cee8a0
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