summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorN Balachandran <nbalacha@redhat.com>2018-01-05 08:44:24 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2018-01-09 13:57:17 +0000
commita486a6cc40fed23bc59dbecb415ea5be0ee0d872 (patch)
tree7cfd213c6a460c9ca70bd92c2878dbda7cb4f88f
parentcdb682572ce4a04d847f997dc5ea93e47d3223e3 (diff)
cli: Fixed a use_after_free
gf_event in cli_cmd_volume_create_cbk was accessing memory that had already been freed. > Change-Id: I447c939fa9b31e18819a62c3b356c14cca390787 > BUG: 1530910 > Signed-off-by: N Balachandran <nbalacha@redhat.com> (cherry picked from commit fa903173540df5b82c295a8f7b24848098e49a41) Change-Id: I447c939fa9b31e18819a62c3b356c14cca390787 BUG: 1531371 Signed-off-by: N Balachandran <nbalacha@redhat.com>
-rw-r--r--cli/src/cli-cmd-volume.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index f9c16c3d792..2ad6368ee3b 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -253,11 +253,12 @@ out:
cli_out ("Volume create failed");
}
- CLI_STACK_DESTROY (frame);
if (ret == 0) {
gf_event (EVENT_VOLUME_CREATE, "name=%s;bricks=%s",
(char *)words[2], bricks);
}
+
+ CLI_STACK_DESTROY (frame);
return ret;
}