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:
cdd98aa
)
s3:winbind: Add sanity check when closing fd
author
Andreas Schneider
<asn@samba.org>
Wed, 16 May 2018 09:59:09 +0000
(11:59 +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 9c2773d5d670e0f165e0f376617cdd8a0f4a0084..52b4c2c689fc480d7a5c848c6f9e55c69c861c6a 100644
(file)
--- 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;
}