summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sotoudeh <matthew@masot.net>2024-05-17 15:39:56 -0700
committerMatthew Sotoudeh <matthew@masot.net>2024-05-17 15:39:56 -0700
commit221b05e7a86faa38036429d5fbfc8b0779eb5382 (patch)
treed7b769022e75445bedeed99118c705e34ead5d5f
parent69038d2d0b59ef8c87a70a24f642106665030282 (diff)
fix bug
-rw-r--r--magic_buddy/magic_buddy.c1
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));
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback