1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

pt_destroy: possible leaking pipe side

Updates the `lws_pt_destroy()` logic to ensure the pipe fds are closed if either `pt->dummy_pipe_fds[0]` or `pt->dummy_pipe_fds[1]` are still valid (previously was only checking `pt->dummy_pipe_fds[0]` which was resulting in the write fd to leak whenever a context was destroyed).
This commit is contained in:
Earl Robsham 2022-10-19 17:11:59 -04:00 committed by Andy Green
parent e639e10ada
commit 81b3944369

View file

@ -1805,9 +1805,9 @@ lws_pt_destroy(struct lws_context_per_thread *pt)
pt->pipe_wsi = NULL;
}
if (pt->dummy_pipe_fds[0]
if ((pt->dummy_pipe_fds[0] || pt->dummy_pipe_fds[1])
#if !defined(WIN32)
&& (int)pt->dummy_pipe_fds[0] != -1
&& ((int)pt->dummy_pipe_fds[0] != -1 || (int)pt->dummy_pipe_fds[1] != -1)
#endif
) {
struct lws wsi;