From e2d16d5e60f3864c816824618fd86d0c6f5bcd61 Mon Sep 17 00:00:00 2001 From: nik-redhat Date: Thu, 2 Jul 2020 18:10:32 +0530 Subject: 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 --- xlators/mgmt/glusterd/src/glusterd-volgen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index f48b4de7f02..087be916c23 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); -- cgit