mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-29 04:52:16 +00:00
Fix memory leak
This was SVN commit r6769.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user