warmcat/libwebsockets — pull request #51 by arnaudviala (2014-02-07 16:22:17+00:00)
Title: Fixed a memory leak in libwebsocket_context_destroy() by changing some #ifndef flags.

In the function libwebsocket_context_destroy(), 'wsi' sessions in lws_loookup[] were only closed and freed if extensions support is enabled. (I'm not using "extensions" and discovered that sessions were not closed/freed).

This applied also with invocation of the callback with reason=PROTOCOL_DESTROY. I think it should be done with and without extensions support.

So I moved a little bit some #ifndef LWS_NO_EXTENSIONS lines to surround only extensions source code.

In my pull request, there is also another compilation fix : when compiling without OPENSSL support, the lws_sigusr2 needs to be protected inside #ifdef LWS_OPENSSL_SUPPORT.
(otherwise gcc -Werror failed saying that function is defined but not used)