summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2018-05-16 14:06:36 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-05-17 17:30:08 +0200
commite1dad1d8ddeb9281b267186163dc4109cae3d599 (patch)
tree9b7d4d027195726cf1c9a77df0f2a347bf13a52d /source3
parent2a0ad57b211ad87709e5886f319a450c4f9db3fd (diff)
downloadsamba-e1dad1d8ddeb9281b267186163dc4109cae3d599.tar.gz
s3:winbind: Check if we have an open file descriptor
Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/winbindd/winbindd_cm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 52b4c2c689f..95612034d2f 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -1983,7 +1983,10 @@ static NTSTATUS cm_open_connection(struct winbindd_domain *domain,
&new_conn->cli, &retry);
if (!NT_STATUS_IS_OK(result)) {
/* Don't leak the smb connection socket */
- close(fd);
+ if (fd != -1) {
+ close(fd);
+ fd = -1;
+ }
}
if (!retry)