1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-06 12:58:18 +03:00

bug #1694: Fix memory leak when updating templates with syntax errors

This commit is contained in:
Ruben S. Montero 2012-12-24 14:19:57 +01:00
parent f2201a4c07
commit fae3649a2b

View File

@ -24,11 +24,11 @@
string& PoolObjectSQL::to_xml64(string &xml64)
{
string *str64;
to_xml(xml64);
str64 = SSLTools::base64_encode(xml64);
xml64 = *str64;
delete str64;
@ -138,7 +138,7 @@ void PoolObjectSQL::set_template_error_message(const string& message)
{
VectorAttribute * attr;
map<string,string> error_value;
char str[26];
time_t the_time;
@ -175,9 +175,10 @@ int PoolObjectSQL::replace_template(const string& tmpl_str, string& error)
error = "Cannot allocate a new template";
return -1;
}
if ( new_tmpl->parse_str_or_xml(tmpl_str, error) != 0 )
{
delete new_tmpl;
return -1;
}
@ -186,7 +187,7 @@ int PoolObjectSQL::replace_template(const string& tmpl_str, string& error)
obj_template = new_tmpl;
return 0;
}
}
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */