mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
lws_protocol_vh_priv_get: fail gracefully with NULL vhost
This commit is contained in:
parent
98df6722ea
commit
59687e04e0
1 changed files with 1 additions and 1 deletions
|
@ -86,7 +86,7 @@ lws_protocol_vh_priv_get(struct lws_vhost *vhost, const struct lws_protocols *pr
|
||||||
{
|
{
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
|
||||||
if (!vhost->protocol_vh_privs)
|
if (!vhost || !vhost->protocol_vh_privs)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
while (n < vhost->count_protocols && &vhost->protocols[n] != prot)
|
while (n < vhost->count_protocols && &vhost->protocols[n] != prot)
|
||||||
|
|
Loading…
Add table
Reference in a new issue