Skip to content

Commit

Permalink
Merge pull request #1623 from lasseo/pua_reginfo_crashfix
Browse files Browse the repository at this point in the history
pua_reginfo: fix crash and issue during load
  • Loading branch information
miconda committed Aug 22, 2018
2 parents 0bd3c9e + 62e0af0 commit 9c79375
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/modules/pua_reginfo/notify.c
Expand Up @@ -111,7 +111,7 @@ int process_contact(udomain_t * domain, urecord_t ** ul_record, str aor, str cal
ci.expires = time(0) + expires;

/* set ruid */
if(sruid_next(&_reginfo_sruid) < 0) {
if(sruid_next_safe(&_reginfo_sruid) < 0) {
LM_ERR("failed to generate ruid");
} else {
ci.ruid = _reginfo_sruid.uid;
Expand Down Expand Up @@ -306,9 +306,15 @@ int process_body(str notify_body, udomain_t * domain) {
}
ul_contact = ul_contact->next;
}

if (ul.delete_urecord(domain, &aor_key, ul_record) < 0) {
LM_ERR("failed to remove record from usrloc\n");
}
}

/* Record deleted, and should not be used anymore */
ul_record = NULL;


/* If already a registration with contacts was found, then keep that result.
otherwise the result is now "No contacts found" */
if (final_result != RESULT_CONTACTS_FOUND) final_result = RESULT_NO_CONTACTS;
Expand Down

0 comments on commit 9c79375

Please sign in to comment.