forked from 0ad/0ad
Fix memory leak
This was SVN commit r6769.
This commit is contained in:
parent
fd20cda5b6
commit
079d9032ac
@ -119,7 +119,9 @@ static AtSmartPtr<AtNode> ConvertNode(xmlNodePtr node)
|
||||
{
|
||||
std::string name ("@");
|
||||
name += (const char*)cur_attr->name;
|
||||
std::wstring value (fromXmlChar(xmlNodeGetContent(cur_attr->children)));
|
||||
xmlChar* content = xmlNodeGetContent(cur_attr->children);
|
||||
std::wstring value (fromXmlChar(content));
|
||||
xmlFree(content);
|
||||
|
||||
AtNode* newNode = new AtNode(value.c_str());
|
||||
obj->children.insert(AtNode::child_pairtype(
|
||||
@ -138,7 +140,9 @@ static AtSmartPtr<AtNode> ConvertNode(xmlNodePtr node)
|
||||
}
|
||||
else if (cur_node->type == XML_TEXT_NODE)
|
||||
{
|
||||
std::wstring value (fromXmlChar(xmlNodeGetContent(cur_node)));
|
||||
xmlChar* content = xmlNodeGetContent(cur_node);
|
||||
std::wstring value (fromXmlChar(content));
|
||||
xmlFree(content);
|
||||
obj->value += value;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user