MT#57429 compiler can assume that the address of 'req' will never be NULL

It's been noticed that in the DSMCall::onInvite() we get this:

     DSMCall.cpp: In member function 'virtual void DSMCall::onInvite(const AmSipRequest&)':
     DSMCall.cpp:112:34: warning: the compiler can assume that the address of 'req' will never be NULL [-Waddress]
       112 |   avar[DSM_AVAR_REQUEST] = AmArg(&req);
           |                                  ^~~~
     DSMCall.cpp:112:34: warning: 'nonnull' argument 'req' compared to NULL [-Wnonnull-compare]
       112 |   avar[DSM_AVAR_REQUEST] = AmArg(&req);
           |                                  ^~~~

Just manage the AmArg construction via the `DSMSipRequest`.

Change-Id: I007e319dd64bf60788efa2d46dfc15b056ee33d7
mr11.4.1
Donat Zenichev 3 years ago
parent d1474f6537
commit d4ca1ec99f

@ -109,7 +109,9 @@ void DSMCall::onInvite(const AmSipRequest& req) {
bool run_session_invite = engine.onInvite(req, this);
avar[DSM_AVAR_REQUEST] = AmArg(&req);
// pass AmSipRequest for use by mod_dlg
DSMSipRequest* sip_req = new DSMSipRequest(&req);
avar[DSM_AVAR_REQUEST] = AmArg(sip_req);
DBG("before runEvent(this, this, DSMCondition::Invite);\n");
AmSipDialog::Status old_st = dlg->getStatus();

Loading…
Cancel
Save