Fixed segfault in libwebsocket_context_destroy.
When creating a context with NULL extensions list, a segmentation fault was yelled when trying to destroy the context. This checks if the extension list is NULL before go through the list. Signed-off-by: Paulo Roberto Urio <paulourio@gmail.com>
This commit is contained in:
parent
d1db83c650
commit
1f680abb7d
1 changed files with 1 additions and 1 deletions
|
@ -2094,7 +2094,7 @@ libwebsocket_context_destroy(struct libwebsocket_context *context)
|
|||
m = LWS_EXT_CALLBACK_CLIENT_CONTEXT_DESTRUCT;
|
||||
if (context->listen_port)
|
||||
m = LWS_EXT_CALLBACK_SERVER_CONTEXT_DESTRUCT;
|
||||
while (ext->callback) {
|
||||
while (ext && ext->callback) {
|
||||
ext->callback(context, ext, NULL, m, NULL, NULL, 0);
|
||||
ext++;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue