From: Anthony Minessale Date: Wed, 29 Apr 2009 19:05:51 +0000 (+0000) Subject: prevent double free X-Git-Tag: v1.0.4~1004 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eae616ef4036dc4becb8b4ea4dcbae5a9bad5f30;p=thirdparty%2Ffreeswitch.git prevent double free git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13195 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index cf05ca10a7..1298ae1385 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -262,10 +262,9 @@ void sofia_handle_sip_i_notify(switch_core_session_t *session, int status, end: - if (sub_state == nua_substate_terminated) { - sofia_private_free(sofia_private); - nua_handle_bind(nh, NULL); - nua_handle_destroy(nh); + if (sub_state == nua_substate_terminated && sofia_private != &mod_sofia_globals.destroy_private) { + sofia_private->destroy_nh = 1; + sofia_private->destroy_me = 1; } }