diff options
author | Yaniv Kaul <ykaul@redhat.com> | 2019-06-05 20:16:40 +0300 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2019-07-16 13:34:56 +0000 |
commit | 7162c8ad9d404773656b4eb02c8fc17f067e7699 (patch) | |
tree | a83da6e6b2be8f4e38d83947347dad9ffb1ffa91 /cli/src/cli-cmd-snapshot.c | |
parent | 6bf9637a93011298d032332ca93009ba4e377e46 (diff) |
cli: defer create_frame() (and dict creation) to later stages.
Where possible, defer create_frame() - whenever possible, after
command line verification, for example.
Change-Id: Id6606e90e7ea6190f30b225c4733b229c519bb2f
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd-snapshot.c')
-rw-r--r-- | cli/src/cli-cmd-snapshot.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cli/src/cli-cmd-snapshot.c b/cli/src/cli-cmd-snapshot.c index 814ab82f6eb..176c6d745b5 100644 --- a/cli/src/cli-cmd-snapshot.c +++ b/cli/src/cli-cmd-snapshot.c @@ -36,12 +36,6 @@ cli_cmd_snapshot_cbk(struct cli_state *state, struct cli_cmd_word *word, proc = &cli_rpc_prog->proctable[GLUSTER_CLI_SNAP]; - frame = create_frame(THIS, THIS->ctx->pool); - if (frame == NULL) { - ret = -1; - goto out; - } - /* Parses the command entered by the user */ ret = cli_cmd_snapshot_parse(words, wordcount, &options, state); if (ret) { @@ -55,6 +49,12 @@ cli_cmd_snapshot_cbk(struct cli_state *state, struct cli_cmd_word *word, goto out; } + frame = create_frame(THIS, THIS->ctx->pool); + if (frame == NULL) { + ret = -1; + goto out; + } + CLI_LOCAL_INIT(local, words, frame, options); if (proc->fn) |