From 396b42ac6db04f57bd4af02a600c860c2196869b Mon Sep 17 00:00:00 2001 From: Andy Green Date: Mon, 19 Mar 2018 08:19:31 +0800 Subject: [PATCH] coverity 188310: mirror plugin: when reach max mirror instances release lock before disconnect --- plugins/protocol_lws_mirror.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/protocol_lws_mirror.c b/plugins/protocol_lws_mirror.c index 646afc6de..f6e2dd498 100644 --- a/plugins/protocol_lws_mirror.c +++ b/plugins/protocol_lws_mirror.c @@ -238,8 +238,10 @@ callback_lws_mirror(struct lws *wsi, enum lws_callback_reasons reason, if (!mi) { /* no existing mirror instance for name */ - if (count_mi == MAX_MIRROR_INSTANCES) + if (count_mi == MAX_MIRROR_INSTANCES) { + lws_pthread_mutex_unlock(&v->lock); /* } vhost lock */ return -1; + } /* create one with this name, and join it */ mi = malloc(sizeof(*mi));