From dcacaf15ec361a6f8bf79037ff47c2a8759b7170 Mon Sep 17 00:00:00 2001 From: Sunny Kumar Date: Tue, 7 Aug 2018 19:02:48 +0530 Subject: snapshot : fix few coverity issues in glusterd-snapshot-utils.c This patch fixes CID 1210987 and 1351650. Change-Id: Ic85bc6048651146a79fe68add19dcc095738a517 updates: bz#789278 Signed-off-by: Sunny Kumar --- xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c index fcfcdb669e1..a9f49e19720 100644 --- a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c @@ -3074,6 +3074,7 @@ glusterd_snap_common_quorum_calculate (glusterd_volinfo_t *volinfo, this = THIS; GF_ASSERT (this); GF_VALIDATE_OR_GOTO (this->name, op_errno, out); + GF_VALIDATE_OR_GOTO (this->name, volinfo, out); /* for replicate volumes with replica count equal to or greater than 3, do quorum check by getting what type @@ -3275,7 +3276,7 @@ glusterd_snap_quorum_check_for_clone (dict_t *dict, gf_boolean_t snap_volume, if (ret) { gf_msg (this->name, GF_LOG_WARNING, 0, GD_MSG_VOL_NOT_FOUND, "volume %s " - "is not in quorum", volinfo->volname); + "is not in quorum", volname); goto out; } } @@ -3990,7 +3991,7 @@ glusterd_restore_geo_rep_files (glusterd_volinfo_t *snap_vol) } out: if (origin_volname) - GF_ASSERT (origin_volname); + GF_FREE (origin_volname); return ret; } -- cgit