From 9424a9fcc9f670766b7557230648e57123edd600 Mon Sep 17 00:00:00 2001 From: Xavier Hernandez Date: Thu, 2 Nov 2017 10:36:36 +0100 Subject: 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 --- cli/src/cli-cmd-volume.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'cli/src/cli-cmd-volume.c') 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) -- cgit