summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2018-05-16 11:59:09 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-05-17 17:30:08 +0200
commit2a0ad57b211ad87709e5886f319a450c4f9db3fd (patch)
tree7fd765d8ee73a65b638a4b4ef1148a3675dea18d /source3/winbindd
parentcdd98aa1e2116fb97e16718d115ee883fe1bc8ba (diff)
downloadsamba-2a0ad57b211ad87709e5886f319a450c4f9db3fd.tar.gz
s3:winbind: Add sanity check when closing fd
Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/winbindd_cm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 9c2773d5d67..52b4c2c689f 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -1738,8 +1738,10 @@ static bool find_new_dc(TALLOC_CTX *mem_ctx,
TALLOC_FREE(addrs);
num_addrs = 0;
- close(*fd);
- *fd = -1;
+ if (*fd != -1) {
+ close(*fd);
+ *fd = -1;
+ }
goto again;
}