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

Joshua Colp asteriskteam at digium.com
Wed May 27 09:36:14 CDT 2020


Joshua Colp has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/14444 )


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(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/44/14444/1

diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index de2a4e2..a595749 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -3695,7 +3695,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/+/14444
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I31e7b958e397cbdaeedd0ebb70bcf8dd2ed3c4d5
Gerrit-Change-Number: 14444
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200527/36c53383/attachment.html>


More information about the asterisk-code-review mailing list