From 965ebc8b286afee827b820479cc1714a2aeb46cc Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Fri, 7 Oct 2016 21:10:37 +1100 Subject: [PATCH] util: remove unused variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Also initialise page at declaration. Reviewed-by: Nicolai Hähnle --- src/util/slab.c | 6 ++---- 1 file 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; -- 2.30.2