diff options
author | Xavier Hernandez <jahernan@redhat.com> | 2017-11-02 10:36:36 +0100 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2017-11-03 05:04:49 +0000 |
commit | 9424a9fcc9f670766b7557230648e57123edd600 (patch) | |
tree | 80d103cbe214188f874197f977ecdce23234f25d /cli | |
parent | 8e973d3ab96d290a32ae3fdbdd1cf867b7060483 (diff) |
cli: Fix several coverity issues in cli-cmd-volume.c
This patch fixes issues 133, 486, 487 and 691 from [1]
[1] https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2017-10-30-9aa574a5/html/
Change-Id: I1a6ca4870ac105ea4c634fc18293229a56ab8596
BUG: 789278
Signed-off-by: Xavier Hernandez <jahernan@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r-- | cli/src/cli-cmd-volume.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index f9c16c3d792..53f304023bd 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -1077,9 +1077,11 @@ out: } else { #if (USE_EVENTS) gf_event (EVENT_VOLUME_ADD_BRICK, "%s", event_str); - GF_FREE (event_str); #endif } +#if (USE_EVENTS) + GF_FREE(event_str); +#endif CLI_STACK_DESTROY (frame); return ret; @@ -1777,10 +1779,6 @@ cli_cmd_bitrot_cbk (struct cli_state *state, struct cli_cmd_word *word, } proc = &cli_rpc_prog->proctable[GLUSTER_CLI_BITROT]; - if (proc == NULL) { - ret = -1; - goto out; - } CLI_LOCAL_INIT (local, words, frame, options); @@ -2865,6 +2863,7 @@ cli_launch_glfs_heal (int heal_op, dict_t *options) break; default: ret = -1; + goto out; } ret = runner_start (&runner); if (ret == -1) |