summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2012-06-05 14:15:54 +0530
committerAnand Avati <avati@redhat.com>2012-06-05 10:45:10 -0700
commit6eee473eba94697953e8b3e1b04fe5ef1de5f474 (patch)
treed435b4f4186690907c39a28257f3707ea86bbeb1 /xlators/protocol
parent04fd2972fe8a9b9568ac781ba7677f13fdce0f57 (diff)
core: coverity fixes (mostly resource leak fixes)
currently working on obvious resource leak reports in coverity Change-Id: I261f4c578987b16da399ab5a504ad0fda0b176b1 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 789278 Reviewed-on: http://review.gluster.com/3265 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/server/src/authenticate.c1
-rw-r--r--xlators/protocol/server/src/server-handshake.c5
-rw-r--r--xlators/protocol/server/src/server-helpers.c4
3 files changed, 8 insertions, 2 deletions
diff --git a/xlators/protocol/server/src/authenticate.c b/xlators/protocol/server/src/authenticate.c
index ffadf2e4d67..d1cdebdee95 100644
--- a/xlators/protocol/server/src/authenticate.c
+++ b/xlators/protocol/server/src/authenticate.c
@@ -96,6 +96,7 @@ init (dict_t *this, char *key, data_t *value, void *data)
if (!auth_handle->vol_opt) {
dict_set (this, key, data_from_dynptr (NULL, 0));
*error = -1;
+ GF_FREE (auth_handle);
dlclose (handle);
return;
}
diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c
index 7761f78c474..abccc389839 100644
--- a/xlators/protocol/server/src/server-handshake.c
+++ b/xlators/protocol/server/src/server-handshake.c
@@ -311,8 +311,6 @@ server_getspec (rpcsvc_request_t *req)
goto fail;
}
ret = read (spec_fd, rsp.spec, file_len);
-
- close (spec_fd);
}
/* convert to XDR */
@@ -323,6 +321,9 @@ fail:
rsp.op_errno = gf_errno_to_error (op_errno);
rsp.op_ret = ret;
+ if (spec_fd != -1)
+ close (spec_fd);
+
server_submit_reply (NULL, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gf_getspec_rsp);
diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c
index 8827a48b041..284b44145ec 100644
--- a/xlators/protocol/server/src/server-helpers.c
+++ b/xlators/protocol/server/src/server-helpers.c
@@ -1289,10 +1289,14 @@ serialize_rsp_direntp (gf_dirent_t *entries, gfs3_readdirp_rsp *rsp)
rsp->reply = trav;
prev = trav;
+ trav = NULL;
}
ret = 0;
out:
+ if (trav)
+ GF_FREE (trav);
+
return ret;
}