Skip to content

Fix incorrect error handling in dom_zvals_to_fragment() #10981

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

Closed
wants to merge 1 commit into from

Conversation

nielsdos
Copy link
Member

Discovered this pre-existing problem while testing GH-10682. Note: this problem existed before that PR.

  • Not all paths throw a hierarchy request error
  • xmlFreeNode must be used instead of xmlFree for the fragment to also free its children.
  • Free up nodes that couldn't be added when xmlAddChild fails.

I unified the error handling code that's exactly the same with a goto to prevent at least some of such problems in the future.

Discovered this pre-existing problem while testing phpGH-10682.
Note: this problem existed *before* that PR.

* Not all paths throw a hierarchy request error
* xmlFreeNode must be used instead of xmlFree for the fragment to also
  free its children.
* Free up nodes that couldn't be added when xmlAddChild fails.

I unified the error handling code that's exactly the same with a goto to
prevent at least some of such problems in the future.

Closes phpGH-10981.
@nielsdos nielsdos force-pushed the fix-dom-error-handling branch from 0063ee4 to 12c86a8 Compare April 3, 2023 17:58
@nielsdos nielsdos closed this in 0579beb Apr 3, 2023
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

Successfully merging this pull request may close these issues.

2 participants