Skip to content

Commit

Permalink
avoid NULL dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
ekoby committed Dec 14, 2023
1 parent dfb3e29 commit 34c881b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ void *alloc_unpooled_obj(size_t size, void (*clear_func)(void *)) {
obj->size = size;
obj->pool = NULL;
obj->clear_func = clear_func;
return obj->obj;
}
return obj->obj;
return NULL;
}

void *pool_alloc_obj(pool_t *pool) {
Expand Down

0 comments on commit 34c881b

Please sign in to comment.