Changeset 1d93f77 in mainline


Ignore:
Timestamp:
2025-04-24T22:03:49Z (6 weeks ago)
Author:
GitHub <noreply@…>
Parents:
9fc15f90 (diff), a22c62f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Wayne Thornton <wmthornton-dev@…> (2025-04-24 22:03:49)
git-committer:
GitHub <noreply@…> (2025-04-24 22:03:49)
Message:

Merge branch 'HelenOS:master' into master

File:
1 edited

Legend:

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

    r9fc15f90 r1d93f77  
    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. */
     
    205209         * slab_free() will detect it and panic.
    206210         */
    207         size_t size = ((size_t *) obj)[-1];
    208         mem_free(obj - _offset, alignof(max_align_t), size + _offset);
     211        if (obj) {
     212                size_t size = ((size_t *) obj)[-1];
     213                mem_free(obj - _offset, alignof(max_align_t), size + _offset);
     214        }
    209215}
    210216
Note: See TracChangeset for help on using the changeset viewer.