summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2016-07-28 08:21:45 +0000
committerNanang Izzuddin <nanang@teluu.com>2016-07-28 08:21:45 +0000
commit2d93e5642dfac7686110fc671089b69ddcf52e88 (patch)
tree5a3d4904ca7ca731d846eb6c1406845ed739914b /pjsip
parentb70c0e8e535cbeab70eaf43feac3ed9c52ef10bc (diff)
Fix #1946: Avoid deinitialization of uninitialized client auth session.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5401 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/src/pjsip/sip_dialog.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/pjsip/src/pjsip/sip_dialog.c b/pjsip/src/pjsip/sip_dialog.c
index f03885d6..421ddc41 100644
--- a/pjsip/src/pjsip/sip_dialog.c
+++ b/pjsip/src/pjsip/sip_dialog.c
@@ -92,6 +92,12 @@ static pj_status_t create_dialog( pjsip_user_agent *ua,
pj_list_init(&dlg->inv_hdr);
pj_list_init(&dlg->rem_cap_hdr);
+ /* Init client authentication session. */
+ status = pjsip_auth_clt_init(&dlg->auth_sess, dlg->endpt,
+ dlg->pool, 0);
+ if (status != PJ_SUCCESS)
+ goto on_error;
+
status = pj_mutex_create_recursive(pool, dlg->obj_name, &dlg->mutex_);
if (status != PJ_SUCCESS)
goto on_error;
@@ -283,12 +289,6 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uac( pjsip_user_agent *ua,
/* Initial route set is empty. */
pj_list_init(&dlg->route_set);
- /* Init client authentication session. */
- status = pjsip_auth_clt_init(&dlg->auth_sess, dlg->endpt,
- dlg->pool, 0);
- if (status != PJ_SUCCESS)
- goto on_error;
-
/* Register this dialog to user agent. */
status = pjsip_ua_register_dlg( ua, dlg );
if (status != PJ_SUCCESS)
@@ -506,12 +506,6 @@ pj_status_t create_uas_dialog( pjsip_user_agent *ua,
}
dlg->route_set_frozen = PJ_TRUE;
- /* Init client authentication session. */
- status = pjsip_auth_clt_init(&dlg->auth_sess, dlg->endpt,
- dlg->pool, 0);
- if (status != PJ_SUCCESS)
- goto on_error;
-
/* Increment the dialog's lock since tsx may cause the dialog to be
* destroyed prematurely (such as in case of transport error).
*/