From abf84656593c567e42025eaf6b1961a2294f913b Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 18 Feb 2008 10:43:46 +1100 Subject: Fix possible close of invalid fd if call to socket() returns -1. (This used to be commit f7d2f692994918037e603ef95dd097b03d2c5456) --- source3/lib/util_sock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/lib/util_sock.c') 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); -- cgit