]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix memory leak, don't need su_home_init after su_home new, and use su_home_unref...
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 20 Nov 2006 21:45:00 +0000 (21:45 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 20 Nov 2006 21:45:00 +0000 (21:45 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3424 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c

index 70d148ff1c051066a9f2933d48798f7d8654706e..5dd64332cd1357a72a66815d1c7de915ab1f181d 100644 (file)
@@ -807,7 +807,6 @@ static void attach_private(switch_core_session_t *session,
        tech_pvt->session = session;
 
        tech_pvt->home = su_home_new(sizeof(*tech_pvt->home));
-       su_home_init(tech_pvt->home);
 
        switch_core_session_set_private(session, tech_pvt);
 
@@ -1267,7 +1266,7 @@ static switch_status_t sofia_on_hangup(switch_core_session_t *session)
        switch_clear_flag_locked(tech_pvt, TFLAG_IO);
 
        if (tech_pvt->home) {
-               su_home_deinit(tech_pvt->home);
+               su_home_unref(tech_pvt->home);
                tech_pvt->home = NULL;
        }
 
@@ -4498,7 +4497,6 @@ static void *SWITCH_THREAD_FUNC profile_thread_run(switch_thread_t *thread, void
 
        profile->s_root = su_root_create(NULL);
        profile->home = su_home_new(sizeof(*profile->home));
-       su_home_init(profile->home);
 
        profile->nua = nua_create(profile->s_root, /* Event loop */
                                                          event_callback, /* Callback for processing events */
@@ -4606,7 +4604,7 @@ static void *SWITCH_THREAD_FUNC profile_thread_run(switch_thread_t *thread, void
        }
 
        unreg(profile);
-       su_home_deinit(profile->home);
+       su_home_unref(profile->home);
        
 
        if (switch_event_create(&s_event, SWITCH_EVENT_UNPUBLISH) == SWITCH_STATUS_SUCCESS) {