summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/alignedalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libcsupport/src/alignedalloc.c')
-rw-r--r--cpukit/libcsupport/src/alignedalloc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cpukit/libcsupport/src/alignedalloc.c b/cpukit/libcsupport/src/alignedalloc.c
index b552fc2a0f..9c9ea83bd8 100644
--- a/cpukit/libcsupport/src/alignedalloc.c
+++ b/cpukit/libcsupport/src/alignedalloc.c
@@ -35,6 +35,10 @@
void *aligned_alloc( size_t alignment, size_t size )
{
+ if ( size == 0 ) {
+ return NULL;
+ }
+
return rtems_heap_allocate_aligned_with_boundary( size, alignment, 0 );
}