X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdlib%2Frealloc.c;h=099ad5dd170ea1251c4562d62bf70a295102bcc6;hb=01c88bc38e78e9b2c47917b85b9b497187946e3c;hp=c2bebd47a14079d8e91b271749e9efb48d9fc5fd;hpb=32d523defc53a80f1e15e977a4c7a616acc464c3;p=pdclib diff --git a/functions/stdlib/realloc.c b/functions/stdlib/realloc.c index c2bebd4..099ad5d 100644 --- a/functions/stdlib/realloc.c +++ b/functions/stdlib/realloc.c @@ -32,7 +32,10 @@ void * realloc( void * ptr, size_t size ) else { /* Get larger memnode and copy over contents. */ - newptr = malloc( size ); + if ( ( newptr = malloc( size ) ) == NULL ) + { + return NULL; + } memcpy( newptr, ptr, baseptr->size ); } } @@ -52,3 +55,4 @@ int main( void ) } #endif +