MT#62181 Click2Dial: use smart pointer

... for C2DCallerDialog

Change-Id: Ifc51cbbe26440ce8cd9fcfea8866123f7ba1e4f2
mr13.3.1
Richard Fuchs 1 year ago
parent c1d1240d11
commit 5233ee2330

@ -148,19 +148,14 @@ AmSession* Click2DialFactory::onInvite(const AmSipRequest& req, const string& ap
return NULL;
}
AmSession* s = new C2DCallerDialog(req, getAnnounceFile(req), callee_uri, cred.release());
if(s == NULL) {
ERROR("Failed to create a click2dial dialog");
return NULL;
}
auto s = std::make_unique<C2DCallerDialog>(req, getAnnounceFile(req), callee_uri, cred.release());
if (!AmUACAuth::enable(s)) {
if (!AmUACAuth::enable(s.get())) {
ERROR("Failed to get authentication event handler");
delete s;
return NULL;
}
return s;
return s.release();
}

Loading…
Cancel
Save