diff options
Diffstat (limited to 'cpukit/libcsupport/src/malloc.c')
-rw-r--r-- | cpukit/libcsupport/src/malloc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cpukit/libcsupport/src/malloc.c b/cpukit/libcsupport/src/malloc.c index e89408284d..b8139e8370 100644 --- a/cpukit/libcsupport/src/malloc.c +++ b/cpukit/libcsupport/src/malloc.c @@ -279,8 +279,13 @@ void *realloc( MSBUMP(malloc_calls, -1); /* subtract off the malloc */ + /* + * There used to be a free on this error case but it is wrong to + * free the memory per OpenGroup Single UNIX Specification V2 + * and the C Standard. + */ + if ( !new_area ) { - free( ptr ); return (void *) 0; } |