From c70b0604f0296080333d6dd86940782559bd4a5b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 24 May 2017 18:16:41 +0200 Subject: [PATCH] util: slab_destroy_child should check whether it's been initialized MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Samuel Pitoiset Reviewed-by: Nicolai Hähnle --- src/util/slab.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/slab.c b/src/util/slab.c index 4264814cabc..4ce0e9a3485 100644 --- a/src/util/slab.c +++ b/src/util/slab.c @@ -140,6 +140,9 @@ void slab_create_child(struct slab_child_pool *pool, */ void slab_destroy_child(struct slab_child_pool *pool) { + if (!pool->parent) + return; /* the slab probably wasn't even created */ + mtx_lock(&pool->parent->mutex); while (pool->pages) { -- 2.30.2