From e7af149cd15e32d04ad7fd1d07a262467f96b601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20Sepp=C3=A4l=C3=A4?= Date: Sat, 17 Feb 2018 17:21:54 +0200 Subject: [PATCH] C websockify: Fix file descriptor leak After fork() the parent process has a copy of clients file descriptor which needs to be closed by the parent to prevent a descriptor leak. --- other/websocket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/other/websocket.c b/other/websocket.c index cbd9cb8..845862c 100644 --- a/other/websocket.c +++ b/other/websocket.c @@ -861,6 +861,7 @@ void start_server() { break; // Child process exits } else { // parent process settings.handler_id += 1; + close(csock); } } if (pid == 0) {