Changeset 0ccd9daa in rtems


Ignore:
Timestamp:
Sep 4, 2003, 12:41:29 PM (16 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Children:
f6bcc8f
Parents:
cd0bab2
Message:

2003-09-04 Joel Sherrill <joel@…>

PR 479/rtems_misc

  • src/malloc.c: Per multiple standards realloc does not free the original memory if the allocation of the requested larger block fails.
Location:
cpukit/libcsupport
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libcsupport/ChangeLog

    rcd0bab2 r0ccd9daa  
     12003-09-04      Joel Sherrill <joel@OARcorp.com>
     2
     3        PR 479/rtems_misc
     4        * src/malloc.c: Per multiple standards realloc does not free the
     5        original memory if the allocation of the requested larger block
     6        fails.
     7
    182003-09-02      Joel Sherrill <joel@OARcorp.com>
    29
  • cpukit/libcsupport/src/malloc.c

    rcd0bab2 r0ccd9daa  
    280280  MSBUMP(malloc_calls, -1);   /* subtract off the malloc */
    281281
     282  /*
     283   *  There used to be a free on this error case but it is wrong to
     284   *  free the memory per OpenGroup Single UNIX Specification V2
     285   *  and the C Standard.
     286   */
     287
    282288  if ( !new_area ) {
    283     free( ptr );
    284289    return (void *) 0;
    285290  }
Note: See TracChangeset for help on using the changeset viewer.