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

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12692 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2009-03-20 20:41:30 +00:00
parent 3aacae1aa3
commit 5b6b9f89ab
2 changed files with 16 additions and 16 deletions
@@ -2420,8 +2420,8 @@ static int show_as_xml_callback(void *pArg, int argc, char **argv, char **column
}
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 @@ SWITCH_STANDARD_API(show_function)
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) {