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:
39eef8e
)
Fix possible close of invalid fd if call to socket() returns -1.
author
Tim Potter
<tpot@samba.org>
Sun, 17 Feb 2008 23:43:46 +0000
(10:43 +1100)
committer
Jeremy Allison
<jra@samba.org>
Thu, 21 Feb 2008 01:58:50 +0000
(17:58 -0800)
source/lib/util_sock.c
patch
|
blob
|
history
diff --git
a/source/lib/util_sock.c
b/source/lib/util_sock.c
index 71d48d60535f272636bf7ce8ad3f30a0c2a208ba..e040f4631a00e827e870dac668eb813ad35769ae 100644
(file)
--- a/
source/lib/util_sock.c
+++ b/
source/lib/util_sock.c
@@
-1933,7
+1933,8
@@
int create_pipe_sock(const char *socket_dir,
out_close:
SAFE_FREE(path);
- close(sock);
+ if (sock != -1)
+ close(sock);
out_umask:
umask(old_umask);