Changeset d9c3805 in rtems


Ignore:
Timestamp:
Sep 4, 2003, 1:02:57 PM (17 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
b81db49
Parents:
f82edff0
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

    rf82edff0 rd9c3805  
     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

    rf82edff0 rd9c3805  
    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.