diff options
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd.h | 9 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd3_1-mops.c | 8 |
2 files changed, 17 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h index 5470e7774e3..b11ce09fb65 100644 --- a/xlators/mgmt/glusterd/src/glusterd.h +++ b/xlators/mgmt/glusterd/src/glusterd.h @@ -248,6 +248,15 @@ typedef ssize_t (*gd_serialize_t) (struct iovec outmsg, void *args); volpath, hostname, exp_path); \ } +#define GLUSTERD_STACK_DESTROY(frame) do {\ + void *__local = NULL; \ + xlator_t *__xl = NULL; \ + __xl = frame->this; \ + __local = frame->local; \ + frame->local = NULL; \ + STACK_DESTROY (frame->root);\ + } while (0) + int32_t glusterd_brick_from_brickinfo (glusterd_brickinfo_t *brickinfo, char **new_brick); diff --git a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c index 24035428ed0..76b8b9987b6 100644 --- a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c +++ b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c @@ -141,6 +141,7 @@ glusterd3_1_probe_cbk (struct rpc_req *req, struct iovec *iov, out: if (rsp.hostname) free (rsp.hostname);//malloced by xdr + GLUSTERD_STACK_DESTROY (((call_frame_t *)myframe)); return ret; } @@ -236,6 +237,7 @@ glusterd3_1_friend_add_cbk (struct rpc_req * req, struct iovec *iov, out: if (rsp.hostname) free (rsp.hostname);//malloced by xdr + GLUSTERD_STACK_DESTROY (((call_frame_t *)myframe)); return ret; } @@ -330,6 +332,7 @@ respond: if (rsp.hostname) free (rsp.hostname);//malloced by xdr + GLUSTERD_STACK_DESTROY (((call_frame_t *)myframe)); return ret; } @@ -366,6 +369,7 @@ glusterd3_1_friend_update_cbk (struct rpc_req *req, struct iovec *iov, (op_ret)?"RJT":"ACC", str); out: + GLUSTERD_STACK_DESTROY (((call_frame_t *)myframe)); return ret; } int32_t @@ -424,6 +428,7 @@ glusterd3_1_cluster_lock_cbk (struct rpc_req *req, struct iovec *iov, } out: + GLUSTERD_STACK_DESTROY (((call_frame_t *)myframe)); return ret; } @@ -484,6 +489,7 @@ glusterd3_1_cluster_unlock_cbk (struct rpc_req *req, struct iovec *iov, } out: + GLUSTERD_STACK_DESTROY (((call_frame_t *)myframe)); return ret; } @@ -553,6 +559,7 @@ glusterd3_1_stage_op_cbk (struct rpc_req *req, struct iovec *iov, out: if (rsp.op_errstr && strcmp (rsp.op_errstr, "error")) free (rsp.op_errstr); //malloced by xdr + GLUSTERD_STACK_DESTROY (((call_frame_t *)myframe)); return ret; } @@ -715,6 +722,7 @@ out: dict_unref (dict); if (rsp.op_errstr && strcmp (rsp.op_errstr, "error")) free (rsp.op_errstr); //malloced by xdr + GLUSTERD_STACK_DESTROY (((call_frame_t *)myframe)); return ret; } |