Wed Sep 10 09:05:24 EDT 2008 Pekka Pessi <first.last@nokia.com>
* nua_session.c: fixed client request reference counting in nua_session_usage_remove() Bug reported by Della Betta Filippo. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9504 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
46c7e09c4d
commit
5563aa8ae8
|
@ -1 +1 @@
|
|||
Wed Sep 10 12:19:39 EDT 2008
|
||||
Wed Sep 10 12:19:57 EDT 2008
|
||||
|
|
|
@ -258,11 +258,12 @@ void nua_session_usage_remove(nua_handle_t *nh,
|
|||
if (cr == cr0)
|
||||
continue;
|
||||
|
||||
nua_client_request_ref(cr);
|
||||
|
||||
if (nua_invite_client_should_ack(cr)) {
|
||||
ss->ss_reporting = 1;
|
||||
nua_invite_client_ack(cr, NULL);
|
||||
ss->ss_reporting = 0;
|
||||
nua_client_request_clean(cr);
|
||||
}
|
||||
|
||||
if (cr == du->du_cr && cr->cr_orq)
|
||||
|
@ -278,6 +279,8 @@ void nua_session_usage_remove(nua_handle_t *nh,
|
|||
|
||||
nua_client_request_remove(cr);
|
||||
|
||||
nua_client_request_unref(cr);
|
||||
|
||||
cr_next = ds->ds_cr;
|
||||
}
|
||||
|
||||
|
|
|
@ -2154,16 +2154,23 @@ int nua_client_request_queue(nua_client_request_t *cr)
|
|||
int
|
||||
nua_client_request_remove(nua_client_request_t *cr)
|
||||
{
|
||||
if (cr->cr_prev)
|
||||
int retval = 0;
|
||||
int in_queue = cr->cr_prev != NULL;
|
||||
|
||||
if (in_queue) {
|
||||
if ((*cr->cr_prev = cr->cr_next))
|
||||
cr->cr_next->cr_prev = cr->cr_prev;
|
||||
}
|
||||
cr->cr_prev = NULL, cr->cr_next = NULL;
|
||||
|
||||
if (cr->cr_timer) {
|
||||
su_timer_destroy(cr->cr_timer), cr->cr_timer = NULL;
|
||||
nua_client_request_unref(cr);
|
||||
retval = nua_client_request_unref(cr);
|
||||
}
|
||||
|
||||
if (!in_queue)
|
||||
return retval;
|
||||
|
||||
return nua_client_request_unref(cr);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue