diff --git a/lib/core-net/wsi.c b/lib/core-net/wsi.c index 3b8c66201..94154d52a 100644 --- a/lib/core-net/wsi.c +++ b/lib/core-net/wsi.c @@ -192,6 +192,9 @@ lws_callback_vhost_protocols_vhost(struct lws_vhost *vh, int reason, void *in, int n; struct lws *wsi = lws_zalloc(sizeof(*wsi), "fake wsi"); + if (!wsi) + return 1; + wsi->context = vh->context; lws_vhost_bind_wsi(vh, wsi);