Changeset 23d4e6ae in mainline


Ignore:
Timestamp:
2025-04-24T09:51:18Z (12 days ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master
Children:
a22c62f
Parents:
0639afc
Message:

Check for allocation failure in kernel malloc()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/malloc.c

    r0639afc r23d4e6ae  
    190190                return NULL;
    191191
    192         void *obj = mem_alloc(alignof(max_align_t), size + _offset) + _offset;
     192        void *obj = mem_alloc(alignof(max_align_t), size + _offset);
     193        if (!obj)
     194           return NULL;
     195
     196        obj += _offset;
    193197
    194198        /* Remember the allocation size just before the object. */
Note: See TracChangeset for help on using the changeset viewer.