summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server.c
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2014-07-05 12:19:28 +0530
committerNiels de Vos <ndevos@redhat.com>2014-07-14 02:38:19 -0700
commit14aedbab7f07b581510677f7f036be5b35b39ff2 (patch)
treef174a9035af8d82eb5a20b241097d1d8fea83e4e /xlators/protocol/server/src/server.c
parent9d68bd17adf45b158ba8dd89f583805ae1a9e706 (diff)
client_t: Fix memory leaks
Backport of http://review.gluster.org/8247 - 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 BUG: 1116672 Change-Id: Ica87b9cbf02cae34c10789cfb56d1ccdc393cbf0 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8289 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators/protocol/server/src/server.c')
-rw-r--r--xlators/protocol/server/src/server.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c
index 73a453c744e..31f983fab45 100644
--- a/xlators/protocol/server/src/server.c
+++ b/xlators/protocol/server/src/server.c
@@ -202,18 +202,17 @@ server_submit_reply (call_frame_t *frame, rpcsvc_request_t *req, void *arg,
ret = 0;
ret:
- if (state) {
+ if (state)
free_state (state);
- }
- if (frame) {
+ if (client)
gf_client_unref (client);
+
+ if (frame)
STACK_DESTROY (frame->root);
- }
- if (new_iobref) {
+ if (new_iobref)
iobref_unref (iobref);
- }
return ret;
}