Skip to content

Commit

Permalink
registrar: Fix possible crash with no Contact
Browse files Browse the repository at this point in the history
CID #211379
  • Loading branch information
liviuchircu committed Jul 17, 2020
1 parent e7ba585 commit 58fa56c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/registrar/save.c
Expand Up @@ -648,11 +648,6 @@ int save_aux(struct sip_msg* _m, str* forced_binding, void* _d, str* flags_s,
c = get_first_contact(_m);
}

if (pn_enable && pn_inspect_request(_m, &c->uri, &sctx) != 0) {
LM_DBG("SIP PN processing failed\n");
goto error;
}

update_act_time();

if (!uri)
Expand All @@ -674,6 +669,11 @@ int save_aux(struct sip_msg* _m, str* forced_binding, void* _d, str* flags_s,
}
} else {
if (add_contacts(_m, c, (udomain_t*)_d, &sctx) < 0) goto error;

if (pn_enable && pn_inspect_request(_m, &c->uri, &sctx) != 0) {
LM_DBG("SIP PN processing failed\n");
goto error;
}
}

update_stat(accepted_registrations, 1);
Expand Down

0 comments on commit 58fa56c

Please sign in to comment.