Merge "res_pjsip_session.c: Prevent use-after-free with TEST_FRAMEWORK enabled" into 16

This commit is contained in:
Kevin Harwell 2019-12-04 18:02:50 -06:00 committed by Gerrit Code Review
commit 1ea4f0e7c5
1 changed files with 3 additions and 1 deletions

View File

@ -2150,8 +2150,10 @@ static void session_destructor(void *obj)
{
struct ast_sip_session *session = obj;
struct ast_sip_session_delayed_request *delay;
/* We dup the endpoint ID in case the endpoint gets freed out from under us */
const char *endpoint_name = session->endpoint ?
ast_sorcery_object_get_id(session->endpoint) : "<none>";
ast_strdupa(ast_sorcery_object_get_id(session->endpoint)) : "<none>";
ast_debug(3, "Destroying SIP session with endpoint %s\n", endpoint_name);