From db501c73701b620be67b4c33ea16cac983dcd9b1 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Sun, 25 Mar 2012 22:48:09 +0530 Subject: core: fix all the iobuf related refs and unrefs reviewed the code against all the possible places where iobuf/iobref ref unref are present, and hopefully fixed most of the issues around memory leaks with respect to iobuf Change-Id: I9aa30326962991f8e23acedd389a0e962e097885 Signed-off-by: Amar Tumballi BUG: 797875 Reviewed-on: http://review.gluster.com/2994 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy Reviewed-by: Vijay Bellur --- xlators/nfs/server/src/nlm4.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'xlators/nfs/server/src/nlm4.c') diff --git a/xlators/nfs/server/src/nlm4.c b/xlators/nfs/server/src/nlm4.c index 0aa1fc14489..d73d1bce41a 100644 --- a/xlators/nfs/server/src/nlm4.c +++ b/xlators/nfs/server/src/nlm4.c @@ -432,8 +432,6 @@ nlm4svc_submit_reply (rpcsvc_request_t *req, void *arg, nlm4_serializer sfunc) /* Then, submit the message for transmission. */ ret = rpcsvc_submit_message (req, &outmsg, 1, NULL, 0, iobref); - iobuf_unref (iob); - iobref_unref (iobref); if (ret == -1) { gf_log (GF_NLM, GF_LOG_ERROR, "Reply submission failed"); goto ret; @@ -441,6 +439,11 @@ nlm4svc_submit_reply (rpcsvc_request_t *req, void *arg, nlm4_serializer sfunc) ret = 0; ret: + if (iob) + iobuf_unref (iob); + if (iobref) + iobref_unref (iobref); + return ret; } @@ -1040,6 +1043,11 @@ nlm4svc_send_granted (nfs3_call_state_t *cs) goto ret; } ret: + if (iobref) + iobref_unref (iobref); + if (iobuf) + iobuf_unref (iobuf); + rpc_clnt_unref (rpc_clnt); nfs3_call_state_wipe (cs); return; -- cgit