summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorSanju Rakonde <srakonde@redhat.com>2018-09-20 18:45:14 +0530
committerAtin Mukherjee <amukherj@redhat.com>2018-10-01 04:04:36 +0000
commitbaeb5fb5cad8ec7158cd7afb36aa7476f081aee7 (patch)
treec02862b7c4a29803dc98be8ac39cdcacdd1ce77c /xlators
parentd00a2a1b398346bbdc5ac9b3ba4b09fb1ce1e699 (diff)
glusterd: fix coverity issues
This patch fixes CID 1274175, 1175018. 1274175: Buffer size warning 1175018: Resource leak Change-Id: Id18960c249447b8dae35de3ad92bc570e62ddb09 updates: bz#789278 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-brick-ops.c2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
index d4bc8b21cad..2698ef783af 100644
--- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
@@ -1389,7 +1389,7 @@ glusterd_op_perform_add_bricks(glusterd_volinfo_t *volinfo, int32_t count,
goto out;
}
strncpy(brickinfo->mount_dir, brick_mount_dir,
- sizeof(brickinfo->mount_dir));
+ SLEN(brickinfo->mount_dir));
}
ret = glusterd_resolve_brick(brickinfo);
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 736e66a679f..758dafd0a14 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -6629,7 +6629,8 @@ out:
ret = op_ret;
}
}
-
+ if (slave_vol)
+ GF_FREE(slave_vol);
GF_FREE(path_list);
GF_FREE(op_errstr);