d1681e
From 8e353f6f4e919541f8830de835da13c805db66a0 Mon Sep 17 00:00:00 2001
d1681e
From: N Balachandran <nbalacha@redhat.com>
d1681e
Date: Fri, 5 Jan 2018 08:55:09 +0530
d1681e
Subject: [PATCH 134/139] cli: Fixed a use_after_free
d1681e
d1681e
gf_event in cli_cmd_volume_create_cbk was accessing
d1681e
memory that had already been freed.
d1681e
d1681e
>upstream mainline patch : https://review.gluster.org/#/c/19136/
d1681e
d1681e
> Change-Id: I447c939fa9b31e18819a62c3b356c14cca390787
d1681e
> BUG: 1530910
d1681e
> Signed-off-by: N Balachandran <nbalacha@redhat.com>
d1681e
(cherry picked from commit fa903173540df5b82c295a8f7b24848098e49a41)
d1681e
d1681e
Change-Id: I1361b3bfecbd5771f5710b08466b913d807cb60c
d1681e
BUG: 1531041
d1681e
Signed-off-by: N Balachandran <nbalacha@redhat.com>
d1681e
Reviewed-on: https://code.engineering.redhat.com/gerrit/126957
d1681e
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
d1681e
Tested-by: RHGS Build Bot <nigelb@redhat.com>
d1681e
---
d1681e
 cli/src/cli-cmd-volume.c | 3 ++-
d1681e
 1 file changed, 2 insertions(+), 1 deletion(-)
d1681e
d1681e
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
d1681e
index 7110145..2639afa 100644
d1681e
--- a/cli/src/cli-cmd-volume.c
d1681e
+++ b/cli/src/cli-cmd-volume.c
d1681e
@@ -253,11 +253,12 @@ out:
d1681e
                         cli_out ("Volume create failed");
d1681e
         }
d1681e
 
d1681e
-        CLI_STACK_DESTROY (frame);
d1681e
         if (ret == 0) {
d1681e
                 gf_event (EVENT_VOLUME_CREATE, "name=%s;bricks=%s",
d1681e
                           (char *)words[2], bricks);
d1681e
         }
d1681e
+
d1681e
+        CLI_STACK_DESTROY (frame);
d1681e
         return ret;
d1681e
 }
d1681e
 
d1681e
-- 
d1681e
1.8.3.1
d1681e