summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2010-09-02 07:06:47 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-02 06:31:41 -0700
commitee7f340f73eb2b61d5d1f6b881eede3b39432c9f (patch)
treedea647e1a9cba2e1a681befee9ad5ae6675c19ce /xlators/mgmt/glusterd/src/glusterd3_1-mops.c
parent0d1199ecf08cb513db7bcd26db672811207fe5cf (diff)
mgmt/glusterd: memory leak fixes
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1186 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1186
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd3_1-mops.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd3_1-mops.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
index 3f7db7e5b5c..0376f4be13e 100644
--- a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
+++ b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
@@ -93,8 +93,7 @@ glusterd3_1_probe_cbk (struct rpc_req *req, struct iovec *iov,
glusterd_peer_hostname_new (rsp.hostname, &name);
list_add_tail (&name->hostname_list, &peerinfo->hostnames);
peerinfo->rpc = dup_peerinfo->rpc;
- list_del_init (&dup_peerinfo->uuid_list);
- GF_FREE (dup_peerinfo);
+ glusterd_peer_destroy (dup_peerinfo);
}
if (!peerinfo->hostname)
peerinfo->hostname = gf_strdup (rsp.hostname);
@@ -111,6 +110,7 @@ glusterd3_1_probe_cbk (struct rpc_req *req, struct iovec *iov,
event->peerinfo = peerinfo;
event->ctx = ((call_frame_t *)myframe)->local;
+ ((call_frame_t *)myframe)->local = NULL;
ret = glusterd_friend_sm_inject_event (event);
@@ -203,6 +203,7 @@ glusterd3_1_friend_add_cbk (struct rpc_req * req, struct iovec *iov,
goto out;
ctx = ((call_frame_t *)myframe)->local;
+ ((call_frame_t *)myframe)->local = NULL;
GF_ASSERT (ctx);
@@ -212,7 +213,8 @@ glusterd3_1_friend_add_cbk (struct rpc_req * req, struct iovec *iov,
glusterd_friend_sm ();
glusterd_op_sm ();
}
-
+ if (ctx)
+ glusterd_destroy_probe_ctx (ctx);
out:
return ret;
}
@@ -236,6 +238,7 @@ glusterd3_1_friend_remove_cbk (struct rpc_req * req, struct iovec *iov,
GF_ASSERT (conf);
ctx = ((call_frame_t *)myframe)->local;
+ ((call_frame_t *)myframe)->local = NULL;
GF_ASSERT (ctx);
if (-1 == req->rpc_status) {
@@ -289,6 +292,8 @@ inject:
glusterd_friend_sm ();
glusterd_op_sm ();
+ if (ctx)
+ glusterd_destroy_probe_ctx (ctx);
op_ret = 0;