From 9af20af096a14c6297ca8f89697f2a9e4e83bd8f Mon Sep 17 00:00:00 2001 From: Akarsha Rai Date: Thu, 28 Sep 2017 07:18:56 -0400 Subject: core: Verify pool pointer before destroying it Problem: Current code is not checking whether the pool pointer is null or not. Solution: Updated the code to verify pool pointer. Bug: 1496675 Change-Id: Ie1f2de4e4204fde15d2b1e3a966ea4c9e7b41534 Signed-off-by: Akarsha Rai --- libglusterfs/src/mem-pool.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libglusterfs/src') diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c index a2889146a5b..a972f67bb17 100644 --- a/libglusterfs/src/mem-pool.c +++ b/libglusterfs/src/mem-pool.c @@ -849,6 +849,9 @@ mem_put (void *ptr) void mem_pool_destroy (struct mem_pool *pool) { + if (!pool) + return; + /* remove this pool from the owner (glusterfs_ctx_t) */ LOCK (&pool->ctx->lock); { -- cgit