diff options
author | Amar Tumballi <amarts@redhat.com> | 2018-10-08 13:21:38 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2018-10-09 19:17:21 +0000 |
commit | 3fa73bfdb5183cb8077d43c3c219c3fd9e9a1b65 (patch) | |
tree | bf6fbca90173b8028db68a99f94c4400ad41d120 /cli/src/cli.c | |
parent | 8d4c5e022bba1b99786ce13f407c27024beccc23 (diff) |
cli: memory leak issues reported by asan
With this fix, a run on 'rpc-coverage.t' passes properly.
This should help to get started with other fixes soon!
Change-Id: I257ae4e28b9974998a451d3b490cc18c02650ba2
updates: bz#1633930
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'cli/src/cli.c')
-rw-r--r-- | cli/src/cli.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cli/src/cli.c b/cli/src/cli.c index 39a0984a134..d17566b6709 100644 --- a/cli/src/cli.c +++ b/cli/src/cli.c @@ -618,9 +618,6 @@ cli_rpc_init(struct cli_state *state) this = THIS; cli_rpc_prog = &cli_prog; - options = dict_new(); - if (!options) - goto out; /* Connect to glusterd using the specified method, giving preference * to a unix socket connection. If nothing is specified, connect to @@ -640,6 +637,11 @@ cli_rpc_init(struct cli_state *state) "Connecting to remote glusterd at " "%s", state->remote_host); + + options = dict_new(); + if (!options) + goto out; + ret = dict_set_str(options, "remote-host", state->remote_host); if (ret) goto out; @@ -652,7 +654,6 @@ cli_rpc_init(struct cli_state *state) goto out; ret = dict_set_str(options, "transport.address-family", addr_family); - if (ret) goto out; } else { |