summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd_cm.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/winbindd/winbindd_cm.c')
-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)