mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-31 02:43:32 +00:00
fix small issue
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8341 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
a12d1bb34d
commit
67427b0396
@ -101,6 +101,7 @@ struct sofia_private {
|
|||||||
sofia_gateway_t *gateway;
|
sofia_gateway_t *gateway;
|
||||||
char gateway_name[512];
|
char gateway_name[512];
|
||||||
int destroy_nh;
|
int destroy_nh;
|
||||||
|
int destroy_me;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define set_param(ptr,val) if (ptr) {free(ptr) ; ptr = NULL;} if (val) {ptr = strdup(val);}
|
#define set_param(ptr,val) if (ptr) {free(ptr) ; ptr = NULL;} if (val) {ptr = strdup(val);}
|
||||||
|
@ -350,6 +350,11 @@ void sofia_event_callback(nua_event_t event,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sofia_private && sofia_private->destroy_me) {
|
||||||
|
free(sofia_private);
|
||||||
|
sofia_private = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (gateway) {
|
if (gateway) {
|
||||||
sofia_reg_release_gateway(gateway);
|
sofia_reg_release_gateway(gateway);
|
||||||
}
|
}
|
||||||
@ -2108,14 +2113,14 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||||||
if (tech_pvt->sofia_private) {
|
if (tech_pvt->sofia_private) {
|
||||||
sofia_private = tech_pvt->sofia_private;
|
sofia_private = tech_pvt->sofia_private;
|
||||||
tech_pvt->sofia_private = NULL;
|
tech_pvt->sofia_private = NULL;
|
||||||
free(sofia_private);
|
sofia_private->destroy_me = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
tech_pvt->nh = NULL;
|
tech_pvt->nh = NULL;
|
||||||
|
|
||||||
|
|
||||||
} else if (sofia_private) {
|
} else if (sofia_private) {
|
||||||
free(sofia_private);
|
sofia_private->destroy_me = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nh) {
|
if (nh) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user