summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorAkarsha Rai <akrai@redhat.com>2017-09-28 07:18:56 -0400
committerJeff Darcy <jeff@pl.atyp.us>2017-09-29 12:36:23 +0000
commit9af20af096a14c6297ca8f89697f2a9e4e83bd8f (patch)
tree85a5fe70abdb762842408c91de1294e67b5ea936 /libglusterfs
parente348b4df9bfd80be5c521bc4c76faf2693e90692 (diff)
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 <akrai@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/mem-pool.c3
1 files changed, 3 insertions, 0 deletions
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);
{