aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Green <andy@warmcat.com>2021-11-09 09:27:38 +0000
committerAndy Green <andy@warmcat.com>2021-11-09 09:27:41 +0000
commitf8a21fec225a324e9ff8bc5fc05aeffc001d77aa (patch)
tree2b94bc4ed75f7a20acb9a1e2e8e53b7e3b4484cf
parent3e1a1a443dd5c904e8773c425f9bdbeea8a43f08 (diff)
downloadlibwebsockets-f8a21fec225a324e9ff8bc5fc05aeffc001d77aa.tar.gz
adopt: coverity: move vh deref until after pointless check
-rw-r--r--lib/core-net/adopt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/core-net/adopt.c b/lib/core-net/adopt.c
index 963fd3d2..e4119451 100644
--- a/lib/core-net/adopt.c
+++ b/lib/core-net/adopt.c
@@ -122,7 +122,7 @@ __lws_adopt_descriptor_vhost1(struct lws_vhost *vh, lws_adoption_type type,
const char *vh_prot_name, struct lws *parent,
void *opaque, const char *fi_wsi_name)
{
- struct lws_context *context = vh->context;
+ struct lws_context *context;
struct lws_context_per_thread *pt;
struct lws *new_wsi;
int n;
@@ -136,6 +136,8 @@ __lws_adopt_descriptor_vhost1(struct lws_vhost *vh, lws_adoption_type type,
if (!vh)
return NULL;
+ context = vh->context;
+
lws_context_assert_lock_held(vh->context);
n = -1;