From e34d4b4b35eb46649affb9376d7f17d392b6f1bb Mon Sep 17 00:00:00 2001 From: Andy Green Date: Tue, 19 Jan 2016 21:32:08 +0800 Subject: [PATCH] coverity 156860 wsi dereference before NULL check ... bit in reality, wsi can never be NULL Signed-off-by: Andy Green --- lib/libwebsockets.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index ae58daa..23eba4d 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -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 && -- 2.7.4