diff --git a/lib/core-net/adopt.c b/lib/core-net/adopt.c index 212adc4d9..963fd3d24 100644 --- a/lib/core-net/adopt.c +++ b/lib/core-net/adopt.c @@ -133,6 +133,9 @@ __lws_adopt_descriptor_vhost1(struct lws_vhost *vh, lws_adoption_type type, * we initialize it, it may become "live" concurrently unexpectedly... */ + if (!vh) + return NULL; + lws_context_assert_lock_held(vh->context); n = -1;