]>
Commit | Line | Data |
---|---|---|
14efab78 JK |
1 | From 33fd755e819dc85a96718abc0ae26a9b46f14800 Mon Sep 17 00:00:00 2001 |
2 | From: nanang <nanang@localhost> | |
3 | Date: Thu, 28 Jul 2016 08:21:45 +0000 | |
4 | Subject: [PATCH 2/3] Fix #1946: Avoid deinitialization of uninitialized client | |
5 | auth session. | |
6 | ||
7 | --- | |
8 | pjsip/src/pjsip/sip_dialog.c | 18 ++++++------------ | |
9 | 1 file changed, 6 insertions(+), 12 deletions(-) | |
10 | ||
11 | diff --git a/pjsip/src/pjsip/sip_dialog.c b/pjsip/src/pjsip/sip_dialog.c | |
12 | index f03885d..421ddc4 100644 | |
13 | --- a/pjsip/src/pjsip/sip_dialog.c | |
14 | +++ b/pjsip/src/pjsip/sip_dialog.c | |
15 | @@ -92,6 +92,12 @@ static pj_status_t create_dialog( pjsip_user_agent *ua, | |
16 | pj_list_init(&dlg->inv_hdr); | |
17 | pj_list_init(&dlg->rem_cap_hdr); | |
18 | ||
19 | + /* Init client authentication session. */ | |
20 | + status = pjsip_auth_clt_init(&dlg->auth_sess, dlg->endpt, | |
21 | + dlg->pool, 0); | |
22 | + if (status != PJ_SUCCESS) | |
23 | + goto on_error; | |
24 | + | |
25 | status = pj_mutex_create_recursive(pool, dlg->obj_name, &dlg->mutex_); | |
26 | if (status != PJ_SUCCESS) | |
27 | goto on_error; | |
28 | @@ -283,12 +289,6 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uac( pjsip_user_agent *ua, | |
29 | /* Initial route set is empty. */ | |
30 | pj_list_init(&dlg->route_set); | |
31 | ||
32 | - /* Init client authentication session. */ | |
33 | - status = pjsip_auth_clt_init(&dlg->auth_sess, dlg->endpt, | |
34 | - dlg->pool, 0); | |
35 | - if (status != PJ_SUCCESS) | |
36 | - goto on_error; | |
37 | - | |
38 | /* Register this dialog to user agent. */ | |
39 | status = pjsip_ua_register_dlg( ua, dlg ); | |
40 | if (status != PJ_SUCCESS) | |
41 | @@ -506,12 +506,6 @@ pj_status_t create_uas_dialog( pjsip_user_agent *ua, | |
42 | } | |
43 | dlg->route_set_frozen = PJ_TRUE; | |
44 | ||
45 | - /* Init client authentication session. */ | |
46 | - status = pjsip_auth_clt_init(&dlg->auth_sess, dlg->endpt, | |
47 | - dlg->pool, 0); | |
48 | - if (status != PJ_SUCCESS) | |
49 | - goto on_error; | |
50 | - | |
51 | /* Increment the dialog's lock since tsx may cause the dialog to be | |
52 | * destroyed prematurely (such as in case of transport error). | |
53 | */ | |
54 | -- | |
55 | 2.7.4 | |
56 |