summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorSanju Rakonde <srakonde@redhat.com>2018-04-30 19:34:34 +0530
committerAmar Tumballi <amarts@redhat.com>2018-05-06 06:27:57 +0000
commit9e739aef97bedfd30e401575ffb6a67e53eec16f (patch)
treea1a388ef52229c891b14318876ac05a6f5c1cfa2 /xlators
parent17e3f617086da785a3678d7cfa8f68ebd1497023 (diff)
glusterd: Fix for memory leak in volume tier status command
Fixes: bz#1573220 Change-Id: Ia60f40fa4f1e525cae6f571a24e5385ba1e004c0 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-tier.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-tier.c b/xlators/mgmt/glusterd/src/glusterd-tier.c
index 5df87fdfa33..264e36295a8 100644
--- a/xlators/mgmt/glusterd/src/glusterd-tier.c
+++ b/xlators/mgmt/glusterd/src/glusterd-tier.c
@@ -1326,6 +1326,8 @@ glusterd_op_tier_status (dict_t *dict, char **op_errstr, dict_t *rsp_dict,
opinfo.brick_pending_count = 0;
ret = 0;
if (req) {
+ if (req->input.input_val)
+ GF_FREE (req->input.input_val);
GF_FREE (req);
req = NULL;
}
@@ -1339,6 +1341,8 @@ glusterd_op_tier_status (dict_t *dict, char **op_errstr, dict_t *rsp_dict,
&gd_brick_prog, req->op, xdr_gd1_mgmt_brick_op_req);
if (req != NULL) {
+ if (req->input.input_val)
+ GF_FREE (req->input.input_val);
GF_FREE (req);
req = NULL;
}
@@ -1365,6 +1369,10 @@ out:
gf_msg (THIS->name, GF_LOG_ERROR, 0,
GD_MSG_TRANS_OPINFO_SET_FAIL,
"Unable to set transaction's opinfo");
+ if (args.dict)
+ dict_unref (args.dict);
+ if (args.errstr)
+ GF_FREE (args.errstr);
gf_msg_debug (this ? this->name : "glusterd", 0,
"Returning %d. Failed to get tier status", ret);