diff --git a/src/image/Image.cc b/src/image/Image.cc
index 20c5ea1604..af74077a48 100644
--- a/src/image/Image.cc
+++ b/src/image/Image.cc
@@ -324,7 +324,8 @@ error_common:
string& Image::to_xml(string& xml) const
{
- string aux_str;
+ string template_xml;
+ string perms_xml;
ostringstream oss;
oss <<
@@ -335,7 +336,7 @@ string& Image::to_xml(string& xml) const
"" << uname << "" <<
"" << gname << "" <<
"" << name << "" <<
- perms_to_xml(aux_str) <<
+ perms_to_xml(perms_xml) <<
"" << type << "" <<
"" << public_obj << "" <<
"" << persistent_img << "" <<
@@ -346,7 +347,7 @@ string& Image::to_xml(string& xml) const
"" << size_mb << "" <<
"" << state << "" <<
"" << running_vms << "" <<
- obj_template->to_xml(aux_str) <<
+ obj_template->to_xml(template_xml) <<
"";
xml = oss.str();
diff --git a/src/vm/VirtualMachine.cc b/src/vm/VirtualMachine.cc
index 330f59350c..96b9c1f42b 100644
--- a/src/vm/VirtualMachine.cc
+++ b/src/vm/VirtualMachine.cc
@@ -1237,7 +1237,9 @@ string& VirtualMachine::to_xml_extended(string& xml) const
string& VirtualMachine::to_xml_extended(string& xml, bool extended) const
{
- string aux_str;
+ string template_xml;
+ string history_xml;
+ string perm_xml;
ostringstream oss;
oss << ""
@@ -1247,7 +1249,7 @@ string& VirtualMachine::to_xml_extended(string& xml, bool extended) const
<< "" << uname << ""
<< "" << gname << ""
<< "" << name << ""
- << perms_to_xml(aux_str)
+ << perms_to_xml(perm_xml)
<< "" << last_poll << ""
<< "" << state << ""
<< "" << lcm_state << ""
@@ -1258,7 +1260,7 @@ string& VirtualMachine::to_xml_extended(string& xml, bool extended) const
<< "" << cpu << ""
<< "" << net_tx << ""
<< "" << net_rx << ""
- << obj_template->to_xml(aux_str);
+ << obj_template->to_xml(template_xml);
if ( hasHistory() )
{
@@ -1268,12 +1270,12 @@ string& VirtualMachine::to_xml_extended(string& xml, bool extended) const
{
for (unsigned int i=0; i < history_records.size(); i++)
{
- oss << history_records[i]->to_xml(aux_str);
+ oss << history_records[i]->to_xml(history_xml);
}
}
else
{
- oss << history->to_xml(aux_str);
+ oss << history->to_xml(history_xml);
}
oss << "";
diff --git a/src/vm_template/VMTemplate.cc b/src/vm_template/VMTemplate.cc
index e2e174c374..179363a784 100644
--- a/src/vm_template/VMTemplate.cc
+++ b/src/vm_template/VMTemplate.cc
@@ -206,7 +206,8 @@ error_common:
string& VMTemplate::to_xml(string& xml) const
{
ostringstream oss;
- string aux_str;
+ string template_xml;
+ string perm_str;
oss << ""
<< "" << oid << ""
@@ -215,10 +216,10 @@ string& VMTemplate::to_xml(string& xml) const
<< "" << uname << ""
<< "" << gname << ""
<< "" << name << ""
- << perms_to_xml(aux_str)
+ << perms_to_xml(perm_str)
<< "" << public_obj << ""
<< "" << regtime << ""
- << obj_template->to_xml(aux_str)
+ << obj_template->to_xml(template_xml)
<< "";
xml = oss.str();
diff --git a/src/vnm/VirtualNetwork.cc b/src/vnm/VirtualNetwork.cc
index 7e2859f63e..bd545215a0 100644
--- a/src/vnm/VirtualNetwork.cc
+++ b/src/vnm/VirtualNetwork.cc
@@ -464,7 +464,10 @@ string& VirtualNetwork::to_xml_extended(string& xml) const
string& VirtualNetwork::to_xml_extended(string& xml, bool extended) const
{
ostringstream os;
- string aux_str;
+
+ string template_xml;
+ string leases_xml;
+ string perm_str;
// Total leases is the number of used leases.
int total_leases = 0;
@@ -482,7 +485,7 @@ string& VirtualNetwork::to_xml_extended(string& xml, bool extended) const
"" << uname << "" <<
"" << gname << "" <<
"" << name << "" <<
- perms_to_xml(aux_str) <<
+ perms_to_xml(perm_str) <<
"" << type << "" <<
"" << bridge << ""<<
"" << vlan << "";
@@ -522,14 +525,14 @@ string& VirtualNetwork::to_xml_extended(string& xml, bool extended) const
os << "" << public_obj << "" <<
""<< total_leases << ""<<
- obj_template->to_xml(aux_str);
+ obj_template->to_xml(template_xml);
if (extended)
{
if (leases != 0)
{
os << "" <<
- leases->to_xml(aux_str) <<
+ leases->to_xml(leases_xml) <<
"";
}
else