diff options
author | Shwetha Acharya <sacharya@redhat.com> | 2018-09-24 15:03:18 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2018-09-25 15:24:03 +0000 |
commit | 31dcbb61487ac82b5ae61435add98b0fd1d5e8cc (patch) | |
tree | ee94a66d301b24a6b29753051df9556edc3a9bfe /xlators | |
parent | 5a3d87fd1239500873c31d38838706b64dbb1b91 (diff) |
mgmt/glusterd: NULL pointer dereferencing clang fix
Added a condition check to resolve the issue
Change-Id: I1954e91f7487c052caf5cf98c954d204242f0af9
Updates: bz#1622665
Signed-off-by: Shwetha Acharya <sacharya@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-snapshot.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c index 943352f19c8..543d677f420 100644 --- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c +++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c @@ -8116,6 +8116,12 @@ glusterd_snapshot_clone_postvalidate(dict_t *dict, int32_t op_ret, if (snap_vol) snap = snap_vol->snapshot; + else { + ret = -1; + gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_SNAP_NOT_FOUND, + "Snapshot volume is null"); + goto out; + } /* Fetch snap object from snap_vol and delete it all in case of * * a failure, or else, just delete the snap object as it is not * |