From f8bbf1cef9da21ea55649f5a05a88479853cd8eb Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Mon, 16 Apr 2012 14:50:16 +0530 Subject: 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 Reviewed-on: http://review.gluster.com/3167 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi --- cli/src/cli-cmd-peer.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'cli/src/cli-cmd-peer.c') diff --git a/cli/src/cli-cmd-peer.c b/cli/src/cli-cmd-peer.c index 60756f31..4ac1630e 100644 --- a/cli/src/cli-cmd-peer.c +++ b/cli/src/cli-cmd-peer.c @@ -96,8 +96,8 @@ out: if ((sent == 0) && (parse_error == 0)) cli_out ("Peer probe failed"); } - if (frame) - STACK_DESTROY (frame->root); + + CLI_STACK_DESTROY (frame); return ret; } @@ -164,8 +164,7 @@ out: cli_out ("Peer detach failed"); } - if (frame) - STACK_DESTROY (frame->root); + CLI_STACK_DESTROY (frame); return ret; } @@ -203,8 +202,7 @@ out: cli_out ("Peer status failed"); } - if (frame) - STACK_DESTROY (frame->root); + CLI_STACK_DESTROY (frame); return ret; } -- cgit