From 4e31eda055781a710d285c509d0c51b42e351431 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 4 Jul 2007 07:43:26 +0000 Subject: [PATCH 1/1] r23701: when we create a new socket with socket_accept(), clear any flags that were set in the old one. Otherwise SOCKET_FLAG_NOCLOSE causes a major fd leak --- source/lib/socket/socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/lib/socket/socket.c b/source/lib/socket/socket.c index 548b11ebcc9..89f8fe5a56f 100644 --- a/source/lib/socket/socket.c +++ b/source/lib/socket/socket.c @@ -166,6 +166,7 @@ _PUBLIC_ NTSTATUS socket_accept(struct socket_context *sock, struct socket_conte if (NT_STATUS_IS_OK(status)) { talloc_set_destructor(*new_sock, socket_destructor); + (*new_sock)->flags = 0; } return status; -- 2.34.1