summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-10-07 21:10:37 +1100
committerTimothy Arceri <[email protected]>2016-10-07 21:24:50 +1100
commit965ebc8b286afee827b820479cc1714a2aeb46cc (patch)
treef0f658ac66954804f6a71fd636e5bad52fd8aec9
parenta599b1c2037ac8aca6c92350c8a7b3e42c81deaa (diff)
util: remove unused variable
Also initialise page at declaration. Reviewed-by: Nicolai Hähnle <[email protected]>
-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;