From f68f9106087a3dc4e6da88a09285ac723096d7e9 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Wed, 7 Nov 2018 06:31:19 -0800 Subject: features/changelog: Avoid a potential null dereference Addresses CID 1396292 Change-Id: I9141502a12fb3e18c04d07c79da87a5ebb2cfc23 updates: bz#789278 Signed-off-by: Vijay Bellur --- xlators/features/changelog/lib/src/gf-changelog.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'xlators/features') diff --git a/xlators/features/changelog/lib/src/gf-changelog.c b/xlators/features/changelog/lib/src/gf-changelog.c index 8cfab4fe39..42e2091592 100644 --- a/xlators/features/changelog/lib/src/gf-changelog.c +++ b/xlators/features/changelog/lib/src/gf-changelog.c @@ -160,9 +160,13 @@ gf_changelog_ctx_defaults_init(glusterfs_ctx_t *ctx) return 0; free_pool: - GF_FREE(pool->frame_mem_pool); + if (pool) { + GF_FREE(pool->frame_mem_pool); - GF_FREE(pool->stack_mem_pool); + GF_FREE(pool->stack_mem_pool); + + GF_FREE(pool); + } GF_FREE(ctx->stub_mem_pool); @@ -174,8 +178,6 @@ free_pool: GF_FREE(ctx->logbuf_pool); - GF_FREE(pool); - GF_FREE(ctx->iobuf_pool); GF_FREE(ctx->event_pool); -- cgit