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:
parent
b9a3b808fb
commit
396b42ac6d
1 changed files with 3 additions and 1 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Reference in a new issue