summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cpukit/libcsupport/src/posix_memalign.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cpukit/libcsupport/src/posix_memalign.c b/cpukit/libcsupport/src/posix_memalign.c
index 4e89413c24..418de99275 100644
--- a/cpukit/libcsupport/src/posix_memalign.c
+++ b/cpukit/libcsupport/src/posix_memalign.c
@@ -37,10 +37,6 @@ int posix_memalign(
*memptr = NULL;
- if ( size == 0 ) {
- return 0;
- }
-
if ( alignment < sizeof( void * ) ) {
return EINVAL;
}
@@ -49,6 +45,10 @@ int posix_memalign(
return EINVAL;
}
+ if ( size == 0 ) {
+ return 0;
+ }
+
*memptr = rtems_heap_allocate_aligned_with_boundary( size, alignment, 0 );
if ( *memptr == NULL ) {