From ee7f340f73eb2b61d5d1f6b881eede3b39432c9f Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Thu, 2 Sep 2010 07:06:47 +0000 Subject: mgmt/glusterd: memory leak fixes Signed-off-by: Pranith Kumar K Signed-off-by: Vijay Bellur BUG: 1186 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1186 --- xlators/mgmt/glusterd/src/glusterd3_1-mops.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd3_1-mops.c') 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; -- cgit