diff --git a/src/um/User.cc b/src/um/User.cc index 6810fe4009..0d92f26c65 100644 --- a/src/um/User.cc +++ b/src/um/User.cc @@ -166,11 +166,13 @@ int User::from_xml(const string& xml) // Get associated metadata for the user ObjectXML::get_nodes("/USER/TEMPLATE", content); - if (!content.empty()) + if (content.empty()) { - rc += obj_template->from_xml_node(content[0]); + return -1; } + rc += obj_template->from_xml_node(content[0]); + ObjectXML::free_nodes(content); if (rc != 0)