[Freeswitch-svn] [commit] r3424 - freeswitch/trunk/src/mod/endpoints/mod_sofia

Freeswitch SVN anthm at freeswitch.org
Mon Nov 20 16:45:00 EST 2006


Author: anthm
Date: Mon Nov 20 16:45:00 2006
New Revision: 3424

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c

Log:
fix memory leak, don't need su_home_init after su_home new, and use su_home_unref instead of su_home_deinit

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	Mon Nov 20 16:45:00 2006
@@ -807,7 +807,6 @@
 	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 @@
 	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 @@
 
 	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 @@
 	}
 
 	unreg(profile);
-	su_home_deinit(profile->home);
+	su_home_unref(profile->home);
 	
 
 	if (switch_event_create(&s_event, SWITCH_EVENT_UNPUBLISH) == SWITCH_STATUS_SUCCESS) {



More information about the Freeswitch-svn mailing list