From: Andy Green Date: Tue, 19 Jan 2016 13:29:34 +0000 (+0800) Subject: coverity 156861 context destroy dereference context before NULL check X-Git-Tag: upstream/1.7.3~111 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2e3bf0613977ab0ae859cd7e7cceeedc3abf0c52;p=platform%2Fupstream%2Flibwebsockets.git coverity 156861 context destroy dereference context before NULL check Context could be NULL only if context creation failed in the first place and user error path is bad... no network connectivity at that point... Signed-off-by: Andy Green --- diff --git a/lib/context.c b/lib/context.c index 02b3f1f..26aac35 100644 --- a/lib/context.c +++ b/lib/context.c @@ -326,13 +326,14 @@ lws_context_destroy(struct lws_context *context) { const struct lws_protocols *protocol = NULL; struct lws wsi; - int n, m = context->count_threads; + int n, m; lwsl_notice("%s\n", __func__); if (!context) return; + m = context->count_threads; context->being_destroyed = 1; memset(&wsi, 0, sizeof(wsi));