diff options
author | Matthew Sotoudeh <matthew@masot.net> | 2024-05-17 15:39:56 -0700 |
---|---|---|
committer | Matthew Sotoudeh <matthew@masot.net> | 2024-05-17 15:39:56 -0700 |
commit | 221b05e7a86faa38036429d5fbfc8b0779eb5382 (patch) | |
tree | d7b769022e75445bedeed99118c705e34ead5d5f /magic_buddy/magic_buddy.c | |
parent | 69038d2d0b59ef8c87a70a24f642106665030282 (diff) |
fix bug
Diffstat (limited to 'magic_buddy/magic_buddy.c')
-rw-r--r-- | magic_buddy/magic_buddy.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/magic_buddy/magic_buddy.c b/magic_buddy/magic_buddy.c index 1029f58..15bd23f 100644 --- a/magic_buddy/magic_buddy.c +++ b/magic_buddy/magic_buddy.c @@ -87,6 +87,7 @@ static void *_allocate(size_t logsize, struct buddy *state) { if (logsize == state->root_logsize) return 0; struct free_block *parent = _allocate(logsize + 1, state); + if (!parent) return 0; struct free_block *buddy = buddy_of(parent, logsize, state); // split @parent in half and place the buddy on the avail list. memcpy(buddy->magic, state->magic, sizeof(state->magic)); |