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.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cpukit/libcsupport/src/alignedalloc.c b/cpukit/libcsupport/src/alignedalloc.c
index b552fc2a0f..1999b4cfab 100644
--- a/cpukit/libcsupport/src/alignedalloc.c
+++ b/cpukit/libcsupport/src/alignedalloc.c
@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: BSD-2-Clause
*
- * Copyright (C) 2018 embedded brains GmbH
+ * Copyright (C) 2018 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -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 );
}