Uses pointer instead of std::string copies while applying transformations

This commit is contained in:
Felipe Zimmerle
2016-12-28 01:38:43 -03:00
parent 63f3f2fd8b
commit f62dc287c9
3 changed files with 43 additions and 30 deletions

View File

@@ -123,9 +123,10 @@ void XML::evaluateInternal(Transaction *t,
content = reinterpret_cast<char *>(
xmlNodeGetContent(nodes->nodeTab[i]));
if (content != NULL) {
// FIXME: Memory leak
l->push_back(new collection::Variable(&m_name,
new std::string(content)));
collection::Variable *var = new collection::Variable(&m_name,
new std::string(content));
var->m_dynamic_value = true;
l->push_back(var);
xmlFree(content);
}
}