Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 7d88587 in mainline


Ignore:
Timestamp:
2009-07-14T08:15:21Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
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.