summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd.h
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2012-04-16 14:50:16 +0530
committerVijay Bellur <vijay@gluster.com>2012-04-18 23:53:51 -0700
commitf8bbf1cef9da21ea55649f5a05a88479853cd8eb (patch)
tree1cb0965e2e91ad63eeef3e2f71da654cb201949c /cli/src/cli-cmd.h
parent678efee04855f88919904d98176b0d7c44e543d6 (diff)
cli: do not put the frame->local to mempool since its a calloced structure
In cli, frame->local is not allocated from the internal mempool, rather its calloced. So while destroying the stack, we have to set frame->local to NULL. Otherwise if frame->local is not NULL, STACK_DESTROY will try to put it back to the mempool and thus segfault. Change-Id: I5bd17d099e16fb8e73f3250cc022008e26e28f50 BUG: 812735 Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Reviewed-on: http://review.gluster.com/3167 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd.h')
-rw-r--r--cli/src/cli-cmd.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/cli/src/cli-cmd.h b/cli/src/cli-cmd.h
index 82e0ff113..ba877e2c4 100644
--- a/cli/src/cli-cmd.h
+++ b/cli/src/cli-cmd.h
@@ -30,6 +30,19 @@
#include "cli.h"
#include "list.h"
+#define CLI_STACK_DESTROY(_frame) \
+ do { \
+ if (_frame) { \
+ if (_frame->local) { \
+ gf_log ("cli", GF_LOG_DEBUG, "frame->local " \
+ "is not NULL (%p)", _frame->local); \
+ cli_local_wipe (_frame->local); \
+ _frame->local = NULL; \
+ } \
+ STACK_DESTROY (_frame->root); \
+ } \
+ } while (0);
+
typedef enum {
GF_ANSWER_YES = 1,
GF_ANSWER_NO = 2