From 04072ca0eb691375210e3b273576c611b57044ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A4rt=20Laak?= Date: Mon, 30 Jan 2023 08:51:43 +0200 Subject: [PATCH] Fix pipe end socket fd left open leak --- lib/core-net/close.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/core-net/close.c b/lib/core-net/close.c index a8dc95274..68e874e68 100644 --- a/lib/core-net/close.c +++ b/lib/core-net/close.c @@ -921,7 +921,10 @@ __lws_close_free_wsi_final(struct lws *wsi) if (pt->pipe_wsi == wsi) pt->pipe_wsi = NULL; if (pt->dummy_pipe_fds[0] == wsi->desc.sockfd) + { pt->dummy_pipe_fds[0] = LWS_SOCK_INVALID; + compatible_close(pt->dummy_pipe_fds[1]); + } } wsi->desc.sockfd = LWS_SOCK_INVALID;