[Freeswitch-svn] [commit] r11620 - freeswitch/trunk/src/mod/applications/mod_lcr

FreeSWITCH SVN rupa at freeswitch.org
Tue Feb 3 13:31:41 PST 2009


Author: rupa
Date: Tue Feb  3 15:31:41 2009
New Revision: 11620

Log:
use switch_core_sprintf instead


Modified:
   freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c

Modified: freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c	Tue Feb  3 15:31:41 2009
@@ -138,7 +138,6 @@
 	size_t lstrip;
 	size_t  tstrip;
 	char *data = NULL;
-	char *pooldata = NULL;
 	char *destination_number = NULL;
 	char *orig_destination_number = NULL; 
 
@@ -154,14 +153,9 @@
 		destination_number += lstrip;
 	}
 	
-	data = switch_mprintf("%s%s%s%s%s", cur_route->gw_prefix, cur_route->prefix
-						  , destination_number, cur_route->suffix, cur_route->gw_suffix);
-		
-	/* move to a pool and free here */
-	pooldata = switch_core_strdup(pool, data);
-	switch_safe_free(data);
-	data = pooldata;
-	
+	data = switch_core_sprintf(pool, "%s%s%s%s%s", cur_route->gw_prefix, cur_route->prefix
+								, destination_number, cur_route->suffix, cur_route->gw_suffix);
+			
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Returning Dialstring %s\n", data);
 	return data;
 }



More information about the Freeswitch-svn mailing list