From: Joshua C. Colp Date: Wed, 27 May 2020 14:35:42 +0000 (-0300) Subject: res_pjsip: Use correct pool for storing the contact_user value. X-Git-Tag: 17.5.0-rc1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62611df412af43cfb4fb51558674114d5d9216b5;p=thirdparty%2Fasterisk.git 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 --- diff --git a/res/res_pjsip.c b/res/res_pjsip.c index 2169fa60a2..8ab58e0cc7 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -3967,7 +3967,7 @@ static int create_out_of_dialog_request(const pjsip_method *method, struct ast_s 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); } }