diff options
author | Vijay Bellur <vbellur@redhat.com> | 2018-11-07 06:31:19 -0800 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-11-12 03:38:08 +0000 |
commit | f68f9106087a3dc4e6da88a09285ac723096d7e9 (patch) | |
tree | d5889118a47fe27463eb5d7afec8506cd1ac923b /xlators/features | |
parent | bcf1e8b07491b48c5372924dbbbad5b8391c6d81 (diff) |
features/changelog: Avoid a potential null dereference
Addresses CID 1396292
Change-Id: I9141502a12fb3e18c04d07c79da87a5ebb2cfc23
updates: bz#789278
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features')
-rw-r--r-- | xlators/features/changelog/lib/src/gf-changelog.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/xlators/features/changelog/lib/src/gf-changelog.c b/xlators/features/changelog/lib/src/gf-changelog.c index 8cfab4fe391..42e20915922 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); |