libwebsockets
libwebsockets copied to clipboard
Leaking fds when creating / destroying `lws_context` instances
While investigating a port leak crash in software I maintain, I found that the source of the leak was due to the file descriptors returned by pipe() call in lws_plat_pipe_create() not getting cleaned up in the lws_context_destroy() call.
This can be easily reproduced by just recreating connections (running lws_context_create() / lws_context_destroy() multiple times in the same program).
I created an example client that I was using to debug the leak / test a fix in this branch.
Will be putting in a PR for a potential fix shortly.
PR for the Potential fix: https://github.com/warmcat/libwebsockets/pull/2745