mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
Coverity fixes
This commit is contained in:
parent
2a98642cff
commit
72b482ee15
3 changed files with 11 additions and 3 deletions
|
@ -272,7 +272,7 @@ _lws_dsh_alloc_tail(lws_dsh_t *dsh, int kind, const void *src1, size_t size1,
|
|||
*/
|
||||
s.already_checked = dsh;
|
||||
|
||||
if (dsh->list.owner)
|
||||
if (dsh && dsh->list.owner)
|
||||
lws_dll2_foreach_safe(dsh->list.owner, &s, try_foreign);
|
||||
|
||||
if (!s.best) {
|
||||
|
@ -309,7 +309,8 @@ _lws_dsh_alloc_tail(lws_dsh_t *dsh, int kind, const void *src1, size_t size1,
|
|||
if (replace->next)
|
||||
replace->next->prev = &s.best->list;
|
||||
} else
|
||||
lws_dll2_add_tail(&s.best->list, &dsh->oha[kind].owner);
|
||||
if (dsh)
|
||||
lws_dll2_add_tail(&s.best->list, &dsh->oha[kind].owner);
|
||||
|
||||
assert(s.dsh->locally_free >= s.best->asize);
|
||||
s.dsh->locally_free -= s.best->asize;
|
||||
|
@ -352,7 +353,8 @@ _lws_dsh_alloc_tail(lws_dsh_t *dsh, int kind, const void *src1, size_t size1,
|
|||
if (replace->next)
|
||||
replace->next->prev = &s.best->list;
|
||||
} else
|
||||
lws_dll2_add_tail(&obj->list, &dsh->oha[kind].owner);
|
||||
if (dsh)
|
||||
lws_dll2_add_tail(&obj->list, &dsh->oha[kind].owner);
|
||||
|
||||
assert(s.dsh->locally_free >= asize);
|
||||
s.dsh->locally_free -= asize;
|
||||
|
|
|
@ -133,6 +133,8 @@ done_list:
|
|||
if (info) /* first time */
|
||||
lwsl_err("VH %s: iface %s port %d DOESN'T EXIST\n",
|
||||
vhost->name, vhost->iface, vhost->listen_port);
|
||||
else
|
||||
return -1;
|
||||
return (info->options & LWS_SERVER_OPTION_FAIL_UPON_UNABLE_TO_BIND) == LWS_SERVER_OPTION_FAIL_UPON_UNABLE_TO_BIND?
|
||||
-1 : 1;
|
||||
case LWS_ITOSA_NOT_USABLE:
|
||||
|
@ -140,6 +142,8 @@ done_list:
|
|||
if (info) /* first time */
|
||||
lwsl_err("VH %s: iface %s port %d NOT USABLE\n",
|
||||
vhost->name, vhost->iface, vhost->listen_port);
|
||||
else
|
||||
return -1;
|
||||
return (info->options & LWS_SERVER_OPTION_FAIL_UPON_UNABLE_TO_BIND) == LWS_SERVER_OPTION_FAIL_UPON_UNABLE_TO_BIND?
|
||||
-1 : 1;
|
||||
}
|
||||
|
|
|
@ -323,10 +323,12 @@ bad_conn_format:
|
|||
} while (e > 0);
|
||||
|
||||
pc = lws_hdr_simple_ptr(wsi, _WSI_TOKEN_CLIENT_SENT_PROTOCOLS);
|
||||
#if defined(_DEBUG)
|
||||
if (!pc) {
|
||||
lwsl_parser("lws_client_int_s_hs: no protocol list\n");
|
||||
} else
|
||||
lwsl_parser("lws_client_int_s_hs: protocol list '%s'\n", pc);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* confirm the protocol the server wants to talk was in the list
|
||||
|
|
Loading…
Add table
Reference in a new issue