upnp: fix null ptr access

A part of the patch [1] has been drop during a rebase.
This caused a access to a possible null ptr.

Re-add the null ptr check.

[1] https://gerrit-ring.savoirfairelinux.com/7156

Change-Id: Idfb502cd9b4c5b1e4a020b05120ce0dd21a014cf
This commit is contained in:
Guillaume Roguez
2017-06-21 23:35:04 -04:00
parent 44c31467ff
commit cb99f49fc7

View File

@ -842,9 +842,10 @@ void SIPAccount::doUnregister(std::function<void(bool)> released_cb)
if (released_cb)
released_cb(not isIP2IP());
/* RING_DBG("UPnP: removing port mapping for SIP account."); */
upnp_->setIGDListener();
upnp_->removeMappings();
if (upnpEnabled_) {
upnp_->setIGDListener();
upnp_->removeMappings();
}
}
void