summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server-helpers.c
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2014-07-05 12:19:28 +0530
committerVijay Bellur <vbellur@redhat.com>2014-07-09 05:09:26 -0700
commit82e0fb290db880323613a3791acd33f96d421363 (patch)
treeb011dad9477373295a181d659fa20fef6abbbca0 /xlators/protocol/server/src/server-helpers.c
parent56c7b07c746ba7ae86117f19bbf304e1150184fb (diff)
client_t: Fix memory leaks
- Assign frame->root->client so that gf_client_unref happens in server_connection_cleanup_flush_cbk - Avoid taking extra ref in gf_client_get TODO: The whole reason why there are two types of refs bind, ref-count is to avoid lock inside lock which is not the case now. I will be sending one more patch which will accomplish that as well as changing the tablearray to list Change-Id: Ic9971cf248c5ee2cdbfdef8e9ff6d54e3ec60ced BUG: 1116672 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8247 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/protocol/server/src/server-helpers.c')
-rw-r--r--xlators/protocol/server/src/server-helpers.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c
index ebeaf90c4a7..dbd26539b2f 100644
--- a/xlators/protocol/server/src/server-helpers.c
+++ b/xlators/protocol/server/src/server-helpers.c
@@ -242,7 +242,6 @@ server_connection_cleanup_flush_cbk (call_frame_t *frame, void *cookie,
client_t *client = NULL;
GF_VALIDATE_OR_GOTO ("server", this, out);
- GF_VALIDATE_OR_GOTO ("server", cookie, out);
GF_VALIDATE_OR_GOTO ("server", frame, out);
fd = frame->local;
@@ -298,9 +297,9 @@ do_fd_cleanup (xlator_t *this, client_t* client, fdentry_t *fdentries, int fd_co
}
tmp_frame->local = fd;
-
tmp_frame->root->pid = 0;
gf_client_ref (client);
+ tmp_frame->root->client = client;
memset (&tmp_frame->root->lk_owner, 0,
sizeof (gf_lkowner_t));
@@ -1098,6 +1097,7 @@ server_ctx_get (client_t *client, xlator_t *xlator)
if (client_ctx_set (client, xlator, ctx) != 0) {
LOCK_DESTROY (&ctx->fdtable_lock);
+ GF_FREE (ctx->fdtable);
GF_FREE (ctx);
ctx = NULL;
}