Skip to content

Commit

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

(cherry picked from commit 9bffaa2)
  • Loading branch information
liviuchircu committed Dec 22, 2021
1 parent 5dab31f commit f4ba599
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/presence/subscribe.c
Expand Up @@ -1074,6 +1074,7 @@ int get_stored_info(struct sip_msg* msg, subs_t* subs, int* reply_code,
(s->record_route.len);
if(subs->record_route.s== NULL)
{
lock_release(&subs_htable[i].lock);
ERR_MEM(PKG_MEM_STR);
}
memcpy(subs->record_route.s, s->record_route.s, s->record_route.len);
Expand Down Expand Up @@ -2203,6 +2204,8 @@ int refresh_watcher(str* pres_uri, str* watcher_uri, str* event,
}
s= s->next;
}

lock_release(&subs_htable[hash_code].lock);
return 0;
}

Expand Down

0 comments on commit f4ba599

Please sign in to comment.