[Freeswitch-trunk] [commit] r12692 - in freeswitch/trunk/src: . mod/applications/mod_commands

FreeSWITCH SVN anthm at freeswitch.org
Fri Mar 20 13:41:30 PDT 2009


Author: anthm
Date: Fri Mar 20 15:41:30 2009
New Revision: 12692

Log:
fix xml code to dup the values instead of store direct pointers (scope issue)

Modified:
   freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
   freeswitch/trunk/src/switch_ivr.c

Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c	Fri Mar 20 15:41:30 2009
@@ -2420,8 +2420,8 @@
 	}
 
 	switch_snprintf(id, sizeof(id), "%d", holder->rows);
-
-	switch_xml_set_attr(switch_xml_set_flag(row, SWITCH_XML_DUP), strdup("row_id"), strdup(id));
+	
+	switch_xml_set_attr_d(holder->xml, "row_id", id);
 
 	for (x = 0; x < argc; x++) {
 		char *name = columnNames[x];
@@ -2687,7 +2687,7 @@
 			char *xmlstr;
 			switch_snprintf(count, sizeof(count), "%d", holder.count);
 
-			switch_xml_set_attr(switch_xml_set_flag(holder.xml, SWITCH_XML_DUP), strdup("row_count"), strdup(count));
+			switch_xml_set_attr_d(holder.xml, "row_count", count);
 			xmlstr = switch_xml_toxml(holder.xml, SWITCH_FALSE);
 
 			if (xmlstr) {

Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c	(original)
+++ freeswitch/trunk/src/switch_ivr.c	Fri Mar 20 15:41:30 2009
@@ -1634,67 +1634,67 @@
 	if (!(param = switch_xml_add_child_d(xml, "username", off++))) {
 		return -1;
 	}
-	switch_xml_set_txt(param, caller_profile->username);
+	switch_xml_set_txt_d(param, caller_profile->username);
 
 	if (!(param = switch_xml_add_child_d(xml, "dialplan", off++))) {
 		return -1;
 	}
-	switch_xml_set_txt(param, caller_profile->dialplan);
+	switch_xml_set_txt_d(param, caller_profile->dialplan);
 
 	if (!(param = switch_xml_add_child_d(xml, "caller_id_name", off++))) {
 		return -1;
 	}
-	switch_xml_set_txt(param, caller_profile->caller_id_name);
+	switch_xml_set_txt_d(param, caller_profile->caller_id_name);
 
 	if (!(param = switch_xml_add_child_d(xml, "ani", off++))) {
 		return -1;
 	}
-	switch_xml_set_txt(param, caller_profile->ani);
+	switch_xml_set_txt_d(param, caller_profile->ani);
 
 	if (!(param = switch_xml_add_child_d(xml, "aniii", off++))) {
 		return -1;
 	}
-	switch_xml_set_txt(param, caller_profile->aniii);
+	switch_xml_set_txt_d(param, caller_profile->aniii);
 
 	if (!(param = switch_xml_add_child_d(xml, "caller_id_number", off++))) {
 		return -1;
 	}
-	switch_xml_set_txt(param, caller_profile->caller_id_number);
+	switch_xml_set_txt_d(param, caller_profile->caller_id_number);
 
 	if (!(param = switch_xml_add_child_d(xml, "network_addr", off++))) {
 		return -1;
 	}
-	switch_xml_set_txt(param, caller_profile->network_addr);
+	switch_xml_set_txt_d(param, caller_profile->network_addr);
 
 	if (!(param = switch_xml_add_child_d(xml, "rdnis", off++))) {
 		return -1;
 	}
-	switch_xml_set_txt(param, caller_profile->rdnis);
+	switch_xml_set_txt_d(param, caller_profile->rdnis);
 
 	if (!(param = switch_xml_add_child_d(xml, "destination_number", off++))) {
 		return -1;
 	}
-	switch_xml_set_txt(param, caller_profile->destination_number);
+	switch_xml_set_txt_d(param, caller_profile->destination_number);
 
 	if (!(param = switch_xml_add_child_d(xml, "uuid", off++))) {
 		return -1;
 	}
-	switch_xml_set_txt(param, caller_profile->uuid);
+	switch_xml_set_txt_d(param, caller_profile->uuid);
 
 	if (!(param = switch_xml_add_child_d(xml, "source", off++))) {
 		return -1;
 	}
-	switch_xml_set_txt(param, caller_profile->source);
+	switch_xml_set_txt_d(param, caller_profile->source);
 
 	if (!(param = switch_xml_add_child_d(xml, "context", off++))) {
 		return -1;
 	}
-	switch_xml_set_txt(param, caller_profile->context);
+	switch_xml_set_txt_d(param, caller_profile->context);
 
 	if (!(param = switch_xml_add_child_d(xml, "chan_name", off++))) {
 		return -1;
 	}
-	switch_xml_set_txt(param, caller_profile->chan_name);
+	switch_xml_set_txt_d(param, caller_profile->chan_name);
 
 	return off;
 }



More information about the Freeswitch-trunk mailing list