summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorMohit Agrawal <moagrawal@redhat.com>2018-12-06 22:02:28 +0530
committerAtin Mukherjee <amukherj@redhat.com>2018-12-07 03:48:21 +0000
commitf168db1da76775f11026c922a51a718b54abc4c9 (patch)
tree9d426324108d5bb72012d1d44b0f2c3f671a5f39 /cli
parent4bdabc49d034ab2b76e4861a6e10ae41deb86d5e (diff)
cli: fix memory leak in cli rpc ops
Problem: In some of the cli fops dict_allocate_and_serialize allocate memory for req structure but after submit request it missed to cleanup memory fo req.dict.dict_val Solution: Call GF_FREE for req.dict.dict_val after submit cli request Change-Id: I76c6b3082fa0be21dc595f87701550a318734ea5 updates: bz#1633930 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-rpc-ops.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 4dcabbdb04b..78043cda50b 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -4108,6 +4108,7 @@ cli_quotad_getlimit(call_frame_t *frame, xlator_t *this, void *data)
cli_quotad_getlimit_cbk, (xdrproc_t)xdr_gf_cli_req);
out:
+ GF_FREE(req.dict.dict_val);
gf_log("cli", GF_LOG_DEBUG, "Returning %d", ret);
return ret;
}
@@ -4846,6 +4847,7 @@ gf_cli_rename_volume(call_frame_t *frame, xlator_t *this, void *data)
gf_cli_rename_volume_cbk, (xdrproc_t)xdr_gf_cli_req);
out:
+ GF_FREE(req.dict.dict_val);
gf_log("cli", GF_LOG_DEBUG, "Returning %d", ret);
return ret;
@@ -5420,6 +5422,7 @@ out:
if (op_dict) {
dict_unref(op_dict);
}
+ GF_FREE(req.xdata.xdata_val);
gf_log("cli", GF_LOG_DEBUG, "Returning %d", ret);
return ret;
@@ -8708,6 +8711,7 @@ gf_cli_mount(call_frame_t *frame, xlator_t *this, void *data)
(xdrproc_t)xdr_gf1_cli_mount_req);
out:
+ GF_FREE(req.dict.dict_val);
gf_log("cli", GF_LOG_DEBUG, "Returning %d", ret);
return ret;
}