summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/util/slab.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/util/slab.c b/src/util/slab.c
index cbe4c88d614..4264814cabc 100644
--- a/src/util/slab.c
+++ b/src/util/slab.c
@@ -174,11 +174,9 @@ void slab_destroy_child(struct slab_child_pool *pool)
static bool
slab_add_new_page(struct slab_child_pool *pool)
{
- struct slab_page_header *page;
- unsigned i;
+ struct slab_page_header *page = malloc(sizeof(struct slab_page_header) +
+ pool->parent->num_elements * pool->parent->element_size);
- page = malloc(sizeof(struct slab_page_header) +
- pool->parent->num_elements * pool->parent->element_size);
if (!page)
return false;