diff options
author | Tim Potter <tpot@samba.org> | 2008-02-18 10:43:46 +1100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2008-02-20 17:58:50 -0800 |
commit | abf84656593c567e42025eaf6b1961a2294f913b (patch) | |
tree | 9aef0833c95c42f81216b73604f946e9bbfd935d | |
parent | ec1576e3462725d7b0108ff02740466ad5ef6277 (diff) | |
download | samba-abf84656593c567e42025eaf6b1961a2294f913b.tar.gz samba-abf84656593c567e42025eaf6b1961a2294f913b.tar.bz2 samba-abf84656593c567e42025eaf6b1961a2294f913b.zip |
Fix possible close of invalid fd if call to socket() returns -1.
(This used to be commit f7d2f692994918037e603ef95dd097b03d2c5456)
-rw-r--r-- | source3/lib/util_sock.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c index 71d48d6053..e040f4631a 100644 --- a/source3/lib/util_sock.c +++ b/source3/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); |