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
  • Loading branch information
miconda committed Dec 21, 2015
1 parent 981bcc7 commit 5937b04
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions modules/dmq_usrloc/usrloc_sync.c
Expand Up @@ -56,10 +56,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 5937b04

Please sign in to comment.