fix small issue

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8341 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-05-09 19:35:51 +00:00
parent a12d1bb34d
commit 67427b0396
2 changed files with 8 additions and 2 deletions

View File

@ -101,6 +101,7 @@ struct sofia_private {
sofia_gateway_t *gateway;
char gateway_name[512];
int destroy_nh;
int destroy_me;
};
#define set_param(ptr,val) if (ptr) {free(ptr) ; ptr = NULL;} if (val) {ptr = strdup(val);}

View File

@ -350,6 +350,11 @@ void sofia_event_callback(nua_event_t event,
break;
}
if (sofia_private && sofia_private->destroy_me) {
free(sofia_private);
sofia_private = NULL;
}
if (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) {
sofia_private = tech_pvt->sofia_private;
tech_pvt->sofia_private = NULL;
free(sofia_private);
sofia_private->destroy_me = 1;
}
tech_pvt->nh = NULL;
} else if (sofia_private) {
free(sofia_private);
sofia_private->destroy_me = 1;
}
if (nh) {