Changeset 7d88587 in mainline for uspace/lib/libc/generic/malloc.c


Ignore:
Timestamp:
2009-07-14T08:15:21Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
50cfa6c
Parents:
f450280
Message:

realloc() should really check whether the next block is indeed free.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/generic/malloc.c

    rf450280 r7d88587  
    406406                    (heap_block_head_t *) (((void *) head) + head->size);
    407407               
    408                 if (((void *) next_head < heap_end)
    409                     && (head->size + next_head->size >= real_size)) {
     408                if (((void *) next_head < heap_end) &&
     409                    (head->size + next_head->size >= real_size) &&
     410                    (next_head->free)) {
    410411                        block_check(next_head);
    411412                        block_init(head, head->size + next_head->size, false);
Note: See TracChangeset for help on using the changeset viewer.