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

Changeset d8023313 in mainline


Ignore:
Timestamp:
2018-01-15T21:40:49Z (4 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master
Children:
39330200
Parents:
bc1b297
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-15 21:20:07)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-15 21:40:49)
Message:

Make sure realloc() behaves correctly when new size is 0.

File:
1 edited

Legend:

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

    rbc1b297 rd8023313  
    876876void *realloc(const void *addr, const size_t size)
    877877{
     878        if (size == 0) {
     879                free(addr);
     880                return NULL;
     881        }
     882
    878883        if (addr == NULL)
    879884                return malloc(size);
Note: See TracChangeset for help on using the changeset viewer.