Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reparenting an unlinked node results in double-free #22

Closed
flavorjones opened this issue Apr 22, 2009 · 1 comment
Closed

reparenting an unlinked node results in double-free #22

flavorjones opened this issue Apr 22, 2009 · 1 comment

Comments

@flavorjones
Copy link
Member

this code, run under valgrind, demonstrates:

doc = Nokogiri::XML <<-EOHTML
<root>
 <a>
   <b/>
 </a>
</root>
EOHTML

root = doc.at("root")
a = root.at("a")
b = a.at("b")
a.add_next_sibling(b.unlink)

puts doc.to_s
@flavorjones
Copy link
Member Author

Fixing edge case where a node can be unlinked then reparented. Closed by 763ee20.

flavorjones pushed a commit that referenced this issue Apr 7, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant