Changeset 1d93f77 in mainline
- Timestamp:
- 2025-04-24T22:03:49Z (6 weeks ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/malloc.c
r9fc15f90 r1d93f77 190 190 return NULL; 191 191 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; 193 197 194 198 /* Remember the allocation size just before the object. */ … … 205 209 * slab_free() will detect it and panic. 206 210 */ 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 } 209 215 } 210 216
Note:
See TracChangeset
for help on using the changeset viewer.