[Asterisk-code-review] res_pjsip: Use correct pool for storing the contact_user value. (asterisk[16])

Friendly Automation asteriskteam at digium.com
Wed May 27 15:12:10 CDT 2020


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/14467 )

Change subject: res_pjsip: Use correct pool for storing the contact_user value.
......................................................................

res_pjsip: Use correct pool for storing the contact_user value.

When replacing the user portion of the Contact URI the code
was using the ephemeral pool instead of the tdata pool. This
could cause the Contact user value to become invalid after a
period of time.

The code will now use the tdata pool which persists for the
lifetime of the message instead.

ASTERISK-28794

Change-Id: I31e7b958e397cbdaeedd0ebb70bcf8dd2ed3c4d5
---
M res/res_pjsip.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved
  Friendly Automation: Approved for Submit



diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index 7a9b1a2..0043f2a 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -3913,7 +3913,7 @@
 		contact_hdr = pjsip_msg_find_hdr_by_names((*tdata)->msg, &HCONTACT, &HCONTACTSHORT, NULL);
 		if (contact_hdr) {
 			contact_uri = pjsip_uri_get_uri(contact_hdr->uri);
-			pj_strdup2(pool, &contact_uri->user, endpoint->contact_user);
+			pj_strdup2((*tdata)->pool, &contact_uri->user, endpoint->contact_user);
 		}
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/14467
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I31e7b958e397cbdaeedd0ebb70bcf8dd2ed3c4d5
Gerrit-Change-Number: 14467
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200527/f3e2fcda/attachment.html>


More information about the asterisk-code-review mailing list