From eae616ef4036dc4becb8b4ea4dcbae5a9bad5f30 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 29 Apr 2009 19:05:51 +0000 Subject: [PATCH] prevent double free git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13195 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/sofia.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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; } }