Commit 0579beb
committed
Fix incorrect error handling in dom_zvals_to_fragment()
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.1 parent 3a21a87 commit 0579beb
2 files changed
+14
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
166 | 165 | | |
167 | | - | |
| 166 | + | |
168 | 167 | | |
169 | 168 | | |
170 | 169 | | |
| |||
175 | 174 | | |
176 | 175 | | |
177 | 176 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 177 | + | |
182 | 178 | | |
183 | 179 | | |
184 | 180 | | |
| |||
191 | 187 | | |
192 | 188 | | |
193 | 189 | | |
194 | | - | |
195 | 190 | | |
196 | 191 | | |
197 | 192 | | |
198 | | - | |
199 | | - | |
200 | | - | |
| 193 | + | |
201 | 194 | | |
202 | 195 | | |
203 | 196 | | |
204 | 197 | | |
205 | | - | |
206 | | - | |
207 | 198 | | |
208 | | - | |
| 199 | + | |
209 | 200 | | |
210 | 201 | | |
211 | 202 | | |
212 | 203 | | |
213 | 204 | | |
214 | 205 | | |
215 | 206 | | |
216 | | - | |
217 | | - | |
218 | | - | |
| 207 | + | |
| 208 | + | |
219 | 209 | | |
220 | 210 | | |
221 | | - | |
222 | | - | |
223 | 211 | | |
224 | | - | |
225 | | - | |
| 212 | + | |
226 | 213 | | |
227 | 214 | | |
228 | 215 | | |
229 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
230 | 223 | | |
231 | 224 | | |
232 | 225 | | |
| |||
0 commit comments