summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-rpc-ops.c
diff options
context:
space:
mode:
authorSunny Kumar <sunkumar@redhat.com>2018-12-05 12:33:48 +0530
committerAmar Tumballi <amarts@redhat.com>2018-12-05 21:37:31 +0000
commit7f7716f8194e06754d0417f27bcc40638c9f9f83 (patch)
treecad2da6fa8a5dbc2b492068640f8c6e050af6d09 /cli/src/cli-rpc-ops.c
parentd4723bdd30f0955ca68fec8c01bc87229c6a24c0 (diff)
cli: fix memory leak in cli/src/cli-rpc-ops.c
This Patch fixes memory leak reported by ASan. Leaks are in gf_cli_status_cbk as a result of allocatating memory using gf_asprintf in loop. SUMMARY: AddressSanitizer: 535 byte(s) leaked in 7 allocation(s). Change-Id: If2fd76c7c1ea6fc44baca295050800074f9d1323 updates: bz#1633930 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
Diffstat (limited to 'cli/src/cli-rpc-ops.c')
-rw-r--r--cli/src/cli-rpc-ops.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index e1422cfd68a..4c212d6cde9 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -8479,6 +8479,9 @@ gf_cli_status_cbk(struct rpc_req *req, struct iovec *iov, int count,
} else {
cli_print_brick_status(&status);
}
+
+ /* Allocatated memory using gf_asprintf*/
+ GF_FREE(status.pid_str);
}
cli_out(" ");