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

vhost: handle creation failure without unbalanced call of PROTOCOL_DESTROY

This commit is contained in:
Andy Green 2018-03-08 08:42:50 +08:00
parent dc15a77dfa
commit 862ab64d62

View file

@ -1493,7 +1493,7 @@ lws_vhost_destroy1(struct lws_vhost *vh)
wsi.context = vh->context;
wsi.vhost = vh;
protocol = vh->protocols;
if (protocol) {
if (protocol && vh->created_vhost_protocols) {
n = 0;
while (n < vh->count_protocols) {
wsi.protocol = protocol;