From f168db1da76775f11026c922a51a718b54abc4c9 Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Thu, 6 Dec 2018 22:02:28 +0530 Subject: 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 --- cli/src/cli-rpc-ops.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cli') 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; } -- cgit