summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volgen.c
diff options
context:
space:
mode:
authornik-redhat <nladha@redhat.com>2020-07-02 18:10:32 +0530
committerSanju Rakonde <sanjurakonde@review.gluster.org>2020-07-08 10:29:01 +0000
commite2d16d5e60f3864c816824618fd86d0c6f5bcd61 (patch)
tree298b605e47c5c39a5211c7d9738e4a01df863e56 /xlators/mgmt/glusterd/src/glusterd-volgen.c
parent24ea814fe7d5a5d27fa051d20ab85bc18c051bdc (diff)
glusterd: null dereference
Issue: There has been either an explicit null dereference or a dereference after null check in some cases. Fix: Added the proper condition for null check and fixed null derefencing. CID: 1430106 : Dereference after null check CID: 1430120 : Explicit null dereferenced CID: 1430132 : Dereference after null check CID: 1430134 : Dereference after null check Change-Id: I7e795cf9f7146a633097c26a766f16b159881fa3 Updates: #1060 Signed-off-by: nik-redhat <nladha@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index f48b4de..087be91 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -1679,13 +1679,13 @@ brick_graph_add_posix(volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;
+ this = THIS;
+
if (!graph || !volinfo || !set_dict || !brickinfo) {
gf_smsg(this->name, GF_LOG_ERROR, errno, GD_MSG_INVALID_ARGUMENT, NULL);
goto out;
}
- this = THIS;
- GF_VALIDATE_OR_GOTO("glusterd", this, out);
priv = this->private;
GF_VALIDATE_OR_GOTO("glusterd", priv, out);