From f323205c5218a471cd108c1fa077104579069e90 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sat, 13 Jul 2019 11:37:46 -0700 Subject: [PATCH] COVA10063: check malloc return --- lib/core-net/wsi.c | 3 +++ 1 file changed, 3 insertions(+) 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);