Permalink
Browse files

fix clone method: set doc on nodes to avoid a segfault when XmlNode::…

…XmlNode reads xml_obj->doc->_private
  • Loading branch information...
1 parent b58bfbb commit 68ec74507de46fe2d2de66697ea454845672be01 @thomas-riccardi thomas-riccardi committed Jul 17, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/xml_node.cc
View
@@ -295,7 +295,8 @@ v8::Handle<v8::Value>
XmlNode::clone(bool recurse) {
v8::HandleScope scope;
- return scope.Close(XmlNode::New(xmlCopyNode(xml_obj, recurse)));
+ xmlNode* new_xml_obj = xmlDocCopyNode(xml_obj, xml_obj->doc, recurse);
+ return scope.Close(XmlNode::New(new_xml_obj));
}
v8::Handle<v8::Value>

0 comments on commit 68ec745

Please sign in to comment.