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

Freeswitch SVN anthm at freeswitch.org
Fri May 9 15:35:51 EDT 2008


Author: anthm
Date: Fri May  9 15:35:51 2008
New Revision: 8341

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

Log:
fix small issue

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h	Fri May  9 15:35:51 2008
@@ -101,6 +101,7 @@
 	sofia_gateway_t *gateway;
 	char gateway_name[512];
 	int destroy_nh;
+	int destroy_me;
 };
 
 #define set_param(ptr,val) if (ptr) {free(ptr) ; ptr = NULL;} if (val) {ptr = strdup(val);}

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	Fri May  9 15:35:51 2008
@@ -350,6 +350,11 @@
 		break;
 	}
 
+	if (sofia_private && sofia_private->destroy_me) {
+		free(sofia_private);
+		sofia_private = NULL;
+	}
+
 	if (gateway) {
 		sofia_reg_release_gateway(gateway);
 	}
@@ -2108,14 +2113,14 @@
 			if (tech_pvt->sofia_private) {
 				sofia_private = tech_pvt->sofia_private;
 				tech_pvt->sofia_private = NULL;
-				free(sofia_private);
+				sofia_private->destroy_me = 1;
 			}
 
 			tech_pvt->nh = NULL;		
 
 
 		} else if (sofia_private) {
-			free(sofia_private);
+			sofia_private->destroy_me = 1;
 		}
 
 		if (nh) {



More information about the Freeswitch-svn mailing list