aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--src/serd_internal.h4
2 files changed, 4 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 5a8245c5..f8ecf659 100644
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,9 @@
serd (0.18.3) unstable;
* Fix possible crash in serd_writer_end_anon() when writing invalid lists
+ * Correctly handle posix_memalign failure
- -- David Robillard <d@drobilla.net> Mon, 21 Jan 2013 22:03:07 -0500
+ -- David Robillard <d@drobilla.net> Sun, 03 Feb 2013 15:07:53 -0500
serd (0.18.2) stable;
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