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

coverity 188310: mirror plugin: when reach max mirror instances release lock before disconnect

This commit is contained in:
Andy Green 2018-03-19 08:19:31 +08:00
parent b9a3b808fb
commit 396b42ac6d

View file

@ -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));