Commit 33a0aa38 authored by Guillaume Roguez's avatar Guillaume Roguez

sipaccount: fix nullptr access

SipAccount::CheckNATAddress may use regc_ member
when this one has been previsouly destroyed
and set to nullptr.
This patch checks regc_ value and take care to return correctly,
to prevent call to pjsip_regc_update_contact with nullptr regc.

Change-Id: I97590debd672095fed63ced40d3c541333b773f8
Tuleap: #172
parent d702b297
......@@ -1982,6 +1982,10 @@ SIPAccount::checkNATAddress(pjsip_regc_cbparam *param, pj_pool_t *pool)
RING_ERR("%s", e.what());
// sendUnregister may failed and cause regc_ to be reset to nullptr
// in this case re-registration has been scheduled, so just leave
if (!regc_)
return true;
pjsip_regc_update_contact(regc_, 1, &contact_);
/* Perform new registration */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment