From abcaefc1ff3bf69efdb5dcedcf5513b4ac8a5576 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sat, 13 Jul 2019 12:04:21 -0700 Subject: [PATCH] COVA10745: lws_protocol_init can fail --- lib/core-net/connect.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/core-net/connect.c b/lib/core-net/connect.c index 9ce91eb5f..dcca4ec80 100644 --- a/lib/core-net/connect.c +++ b/lib/core-net/connect.c @@ -53,7 +53,8 @@ lws_client_connect_via_info(const struct lws_client_connect_info *i) return NULL; if (!i->context->protocol_init_done) - lws_protocol_init(i->context); + if (lws_protocol_init(i->context)) + return NULL; /* * If we have .local_protocol_name, use it to select the local protocol * handler to bind to. Otherwise use .protocol if http[s].