diff --git a/src/template/Template.cc b/src/template/Template.cc index 31e300f071..0da76c8965 100644 --- a/src/template/Template.cc +++ b/src/template/Template.cc @@ -460,6 +460,19 @@ int Template::from_xml(const string &xml_str) return -1; } + //Clear the template if not empty + if (!attributes.empty()) + { + multimap::iterator it; + + for ( it = attributes.begin(); it != attributes.end(); it++) + { + delete it->second; + } + + attributes.clear(); + } + // Get the