summaryrefslogtreecommitdiff
path: root/magic_buddy
diff options
context:
space:
mode:
Diffstat (limited to 'magic_buddy')
-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