[Libwebsockets] [libwebsockets] Fixed a memory leak in libwebsocket_context_destroy() by changing some #ifndef flags. (#51)

"Andy Green (林安廸)" andy at warmcat.com
Sat Feb 15 07:42:46 CET 2014


On 08/02/14 00:22, the mail apparently from arnaudviala included:
> 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).

Thanks for the fix

http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/commit/?id=7c6f26c62cc96bec4171e5c263591373441c4675

-Andy

> 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)
>
> ------------------------------------------------------------------------
>
>
>         You can merge this Pull Request by running
>
>    git pull https://github.com/arnaudviala/libwebsockets master
>
> Or view, comment on, or merge it at:
>
> https://github.com/warmcat/libwebsockets/pull/51
>
>
>         Commit Summary
>
>   * Fix a possible memory leak in libwebsocket_context_destroy() when
>     compiled without extension support.
>   * Place lws_sigusr2() inside #ifdef LWS_OPENSSL_SUPPORT flags
>
>
>         File Changes
>
>   * *M* lib/libwebsockets.c
>     <https://github.com/warmcat/libwebsockets/pull/51/files#diff-0> (8)
>
>
>         Patch Links:
>
>   * https://github.com/warmcat/libwebsockets/pull/51.patch
>   * https://github.com/warmcat/libwebsockets/pull/51.diff
>
>> Reply to this email directly or view it on GitHub
> <https://github.com/warmcat/libwebsockets/pull/51>.
>




More information about the Libwebsockets mailing list