mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
coverity 188325: client: require at least once vhost
This commit is contained in:
parent
5a8fca6f79
commit
bfc8a5cb1b
1 changed files with 7 additions and 1 deletions
|
@ -771,6 +771,12 @@ lws_client_connect_via_info(struct lws_client_connect_info *i)
|
|||
if (!wsi->vhost)
|
||||
wsi->vhost = i->context->vhost_list;
|
||||
|
||||
if (!wsi->vhost) {
|
||||
lwsl_err("At least one vhost in the context is required\n");
|
||||
|
||||
goto bail;
|
||||
}
|
||||
|
||||
wsi->protocol = &wsi->vhost->protocols[0];
|
||||
|
||||
/*
|
||||
|
@ -783,7 +789,7 @@ lws_client_connect_via_info(struct lws_client_connect_info *i)
|
|||
* which protocol we are associated with since we can give it a
|
||||
* list.
|
||||
*/
|
||||
if ((i->method || i->local_protocol_name) && wsi->vhost && local) {
|
||||
if ((i->method || i->local_protocol_name) && local) {
|
||||
lwsl_info("binding to %s\n", local);
|
||||
p = lws_vhost_name_to_protocol(wsi->vhost, local);
|
||||
if (p)
|
||||
|
|
Loading…
Add table
Reference in a new issue