git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2a0ad57
)
s3:winbind: Check if we have an open file descriptor
author
Andreas Schneider
<asn@samba.org>
Wed, 16 May 2018 12:06:36 +0000
(14:06 +0200)
committer
Andreas Schneider
<asn@cryptomilk.org>
Thu, 17 May 2018 15:30:08 +0000
(17:30 +0200)
Found by Coverity.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source3/winbindd/winbindd_cm.c
patch
|
blob
|
history
diff --git
a/source3/winbindd/winbindd_cm.c
b/source3/winbindd/winbindd_cm.c
index 52b4c2c689fc480d7a5c848c6f9e55c69c861c6a..95612034d2f939cb29413db91732e605f1750f6d 100644
(file)
--- 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)