diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2020-05-22 11:27:29 +0300 |
---|---|---|
committer | Sanju Rakonde <sanjurakonde@review.gluster.org> | 2020-05-31 18:37:16 +0000 |
commit | 4ccd078a00403e526b5406226e0661d217f49545 (patch) | |
tree | d0846365ab2c760d39a4561423e2f0c0d40b1913 /cli/src | |
parent | eaf126f4b06a842977c1932ce699c4d76421a4b2 (diff) |
cli: fix memory leak in gf_cli_gsync_status_output()
In gf_cli_gsync_status_output(), call to gf_cli_read_status_data()
overwrites 'sts_vals' pointers to areas allocated by GF_CALLOC()
with pointers to dict data, thus making the allocated areas not
accessible.
Change-Id: I00c310aec1a1413caf13ade14dc4fed37b51962c
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Fixes: #1259
Diffstat (limited to 'cli/src')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 7c7151568ef..73eecb77c5b 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -4875,14 +4875,6 @@ gf_cli_gsync_status_output(dict_t *dict, gf_boolean_t is_detail) ret = -1; goto out; } - for (i = 0; i < gsync_count; i++) { - sts_vals[i] = GF_CALLOC(1, sizeof(gf_gsync_status_t), - gf_common_mt_char); - if (!sts_vals[i]) { - ret = -1; - goto out; - } - } ret = gf_cli_read_status_data(dict, sts_vals, spacing, gsync_count, num_of_fields); |