]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
prevent double free
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 29 Apr 2009 19:05:51 +0000 (19:05 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 29 Apr 2009 19:05:51 +0000 (19:05 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13195 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia.c

index cf05ca10a7435be0944861ec555f5a66bf342304..1298ae1385b8ade904d076d75ec63999676df894 100644 (file)
@@ -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;
        }
 
 }