Skip to content

Commit

Permalink
event_virtual: Fix several missing lock_release() ops
Browse files Browse the repository at this point in the history
Credits to @ryancaicse for the report in #2714

(cherry picked from commit e958b02)
  • Loading branch information
liviuchircu committed Dec 20, 2021
1 parent 6fba783 commit 0b8bf0e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/event_virtual/event_virtual.c
Expand Up @@ -466,6 +466,7 @@ static int failover_raise(struct sip_msg *msg, str *ev_name,

cb_param->evi_params = evi_dup_shm_params(params);
if (!cb_param->evi_params) {
lock_release(cur_sock->lock);
LM_ERR("Failed to dup evi params in shm\n");
shm_free(cb_param);
return -1;
Expand Down Expand Up @@ -616,13 +617,15 @@ static int virtual_raise(struct sip_msg *msg, str* ev_name, evi_reply_sock *sock
LM_ERR("unable to parse socket %.*s\n",
vsock->current_sock->sock_str.len,
vsock->current_sock->sock_str.s);
lock_release(rrobin_lock);
return -1;
}

if (vsock->current_sock->trans_mod->raise(msg, ev_name,
vsock->current_sock->sock, params, &async_status)) {
LM_ERR("unable to raise socket %.*s\n",
vsock->current_sock->sock_str.len, vsock->current_sock->sock_str.s);
lock_release(rrobin_lock);
return -1;
}

Expand Down Expand Up @@ -650,8 +653,10 @@ static void virtual_free(evi_reply_sock *sock) {
lock_get(global_lock);

vsock = (struct virtual_socket *)sock->params;
if (!vsock)
if (!vsock) {
lock_release(global_lock);
return;
}

/* free the list of sockets for this virtual socket */
sub_list = vsock->list_sockets;
Expand Down

0 comments on commit 0b8bf0e

Please sign in to comment.