1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

client: connect: confirm we have a protocol

Coverity gets antsy that we were checking wsi->a.protocol for NULL earlier
then start using it... explicitly bail if it's NULL before we start using
it.
This commit is contained in:
Andy Green 2021-11-08 09:45:39 +00:00
parent f3a1263bc1
commit d3783f0c71

View file

@ -450,6 +450,10 @@ lws_client_connect_via_info(const struct lws_client_connect_info *i)
if (i->pwsi)
*i->pwsi = wsi;
if (!wsi->a.protocol)
/* we must have one protocol or another bound by this point */
goto bail;
/* PHASE 8: notify protocol with role-specific connected callback */
/* raw socket per se doesn't want this... raw socket proxy wants it... */