From d4ca1ec99f6a4163b8cd21efedf380b34af0d12e Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Mon, 15 May 2023 10:35:03 +0200 Subject: [PATCH] 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 --- apps/dsm/DSMCall.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/dsm/DSMCall.cpp b/apps/dsm/DSMCall.cpp index 886435ca..c8ae6eb6 100644 --- a/apps/dsm/DSMCall.cpp +++ b/apps/dsm/DSMCall.cpp @@ -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();