Skip to content

Commit

Permalink
dmq_usrloc: lock before adding contact
Browse files Browse the repository at this point in the history
- reported by GH #440

(cherry picked from commit 5937b04)
  • Loading branch information
miconda committed Mar 1, 2016
1 parent df1f509 commit 1e2befe
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions modules/dmq_usrloc/usrloc_sync.c
Expand Up @@ -51,10 +51,13 @@ static int add_contact(str aor, ucontact_info_t* ci)
str contact;
int res;

if (dmq_ul.get_udomain("location", &_d) < 0) {
LM_ERR("Failed to get domain\n");
return -1;
}
if (dmq_ul.get_udomain("location", &_d) < 0) {
LM_ERR("Failed to get domain\n");
return -1;
}

dmq_ul.lock_udomain(_d, &aor);

res = dmq_ul.get_urecord(_d, &aor, &r);
if (res < 0) {
LM_ERR("failed to retrieve record from usrloc\n");
Expand Down

0 comments on commit 1e2befe

Please sign in to comment.