summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-rpc-ops.c
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2012-03-27 18:22:15 +0530
committerVijay Bellur <vijay@gluster.com>2012-04-02 02:44:47 -0700
commitb0bb1a2c979078efa3ab024e14119df6087c4320 (patch)
tree1ef163912d342ff1f595dfcc4e9791d22dde7a67 /cli/src/cli-rpc-ops.c
parentdc2a52fa0d83ba2e807a175655fc0362b707a22d (diff)
cli: do the proper STACK_DESTORY of created frames
* fixes memory leaks * fixes some random local mem-pool empty messages Change-Id: Ic79f279f2acfe4722fa54d52397d0267b3918928 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 803638 Reviewed-on: http://review.gluster.com/3018 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'cli/src/cli-rpc-ops.c')
-rw-r--r--cli/src/cli-rpc-ops.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 6deda9c0007..70c9a3d80aa 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -947,8 +947,10 @@ gf_cli3_1_stop_volume_cbk (struct rpc_req *req, struct iovec *iov,
frame = myframe;
- if (frame)
+ if (frame) {
local = frame->local;
+ frame->local = NULL;
+ }
if (local) {
dict = local->dict;
@@ -988,6 +990,7 @@ out:
free (rsp.dict.dict_val);
if (local)
cli_local_wipe (local);
+
return ret;
}
@@ -1027,8 +1030,10 @@ gf_cli3_1_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov,
frame = myframe;
- if (frame)
+ if (frame) {
local = frame->local;
+ frame->local = NULL;
+ }
if (local) {
local_dict = local->dict;
@@ -1742,6 +1747,9 @@ gf_cli3_1_replace_brick_cbk (struct rpc_req *req, struct iovec *iov,
ret = rsp.op_ret;
out:
+ if (frame)
+ frame->local = NULL;
+
if (local) {
dict_unref (local->dict);
cli_local_wipe (local);
@@ -2951,8 +2959,8 @@ gf_cli3_1_replace_brick (call_frame_t *frame, xlator_t *this,
goto out;
}
- local->dict = dict_ref (dict);
- frame->local = local;
+ local->dict = dict_ref (dict);
+ frame->local = local;
ret = dict_get_int32 (dict, "operation", &op);
if (ret) {
@@ -5496,6 +5504,8 @@ gf_cli_status_volume_all (call_frame_t *frame, xlator_t *this, void *data)
gf_log ("cli", GF_LOG_ERROR, "status all failed");
if (ret && dict)
dict_unref (dict);
+ if (frame)
+ frame->local = NULL;
return ret;
}