diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2014-06-17 17:37:46 +0530 |
---|---|---|
committer | Kaushal M <kaushal@redhat.com> | 2014-06-30 00:15:31 -0700 |
commit | d78d53e853e43f78c59202f1c2e761d17dad93c5 (patch) | |
tree | 94045ca2e0aee00df33510cb9539b1e49c16256c /xlators/mgmt | |
parent | a9797607a968a4d54d1f28f44048ec5925721098 (diff) |
glusterd : Coverity fix in __server_getspec
spec_fd handle should be closed in all the possible cases
CID : 1124768
Change-Id: I28390dc76a646a19258520570acef562b8d6fb1e
BUG: 789278
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/8091
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Gaurav Kumar Garg <ggarg@redhat.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handshake.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handshake.c b/xlators/mgmt/glusterd/src/glusterd-handshake.c index 3cb62624a07..0fd60806da2 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handshake.c +++ b/xlators/mgmt/glusterd/src/glusterd-handshake.c @@ -738,8 +738,6 @@ __server_getspec (rpcsvc_request_t *req) goto fail; } ret = read (spec_fd, rsp.spec, file_len); - - close (spec_fd); } if (brick_name) { @@ -756,6 +754,9 @@ __server_getspec (rpcsvc_request_t *req) /* convert to XDR */ fail: + if (spec_fd > 0) + close (spec_fd); + rsp.op_ret = ret; if (op_errno) |