summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-op-sm.c
diff options
context:
space:
mode:
authorSanju Rakonde <srakonde@redhat.com>2018-09-21 11:55:12 +0530
committerAtin Mukherjee <amukherj@redhat.com>2018-09-22 13:33:33 +0000
commit28bc9e4bf74fd31a9620478b0a0ed482798b5915 (patch)
tree757831eee842dc8225af2c529d8f4712c2977aff /xlators/mgmt/glusterd/src/glusterd-op-sm.c
parent27402fcb27a7e9ea32a6a04fdc21b59af6320bb4 (diff)
glusterd: fix resource leak coverity issues
This patch addresses CID 1288098,1370948 and 1382454 key_fixed is allocated with memory but missed to free it. updates: bz#789278 Change-Id: Iea805c668ba89759313f9e21b328757e570be97b Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 2edaf6ff202..ca09d5afe20 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -1684,16 +1684,11 @@ glusterd_op_stage_reset_volume(dict_t *dict, char **op_errstr)
goto out;
} else if (strcmp(key, "cluster.watermark-low") == 0) {
ret = glusterd_water_limit_check(volinfo, _gf_false, op_errstr);
- if (ret)
- return ret;
} else if (strcmp(key, "cluster.watermark-hi") == 0) {
ret = glusterd_water_limit_check(volinfo, _gf_true, op_errstr);
- if (ret) {
- if (key_fixed)
- GF_FREE(key_fixed);
- return ret;
- }
}
+ if (ret)
+ goto out;
if (!exists) {
ret = snprintf(msg, sizeof(msg), "Option %s does not exist", key);