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:
parent
c097a44405
commit
7b5a070efc
1 changed files with 2 additions and 2 deletions
|
@ -1688,9 +1688,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;
|
||||
|
|
Loading…
Add table
Reference in a new issue