diff options
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 00faffe4281..ef88d04201f 100644 --- a/cli/src/cli.c +++ b/cli/src/cli.c @@ -491,7 +491,6 @@ struct rpc_clnt * cli_rpc_init (struct cli_state *state) { struct rpc_clnt *rpc = NULL; - struct rpc_clnt_config rpc_cfg = {0,}; dict_t *options = NULL; int ret = -1; int port = CLI_GLUSTERD_PORT; @@ -511,9 +510,6 @@ cli_rpc_init (struct cli_state *state) if (state->remote_port) port = state->remote_port; - rpc_cfg.remote_host = state->remote_host; - rpc_cfg.remote_port = port; - ret = dict_set_int32 (options, "remote-port", port); if (ret) goto out; @@ -535,6 +531,11 @@ cli_rpc_init (struct cli_state *state) rpc_clnt_start (rpc); out: + if (ret) { + if (rpc) + rpc_clnt_unref (rpc); + rpc = NULL; + } return rpc; } |