coverity 156860 wsi dereference before NULL check

... bit in reality, wsi can never be NULL

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2016-01-19 21:32:08 +08:00
parent 2e3bf06139
commit e34d4b4b35

View file

@ -84,14 +84,16 @@ lws_remove_from_timeout_list(struct lws *wsi)
void
lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason)
{
struct lws_context *context = wsi->context;
struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi];
struct lws_context *context;
struct lws_context_per_thread *pt;
int n, m, ret, old_state;
struct lws_tokens eff_buf;
if (!wsi)
return;
context = wsi->context;
pt = &context->pt[(int)wsi->tsi];
old_state = wsi->state;
if (wsi->mode == LWSCM_HTTP_SERVING_ACCEPTED &&