mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix persistent XML memory leaks in SOAP
SOAP uses a horrible bailout based error handling approach -- avoid leaking persistent XML memory by catching bailouts in a number of places.
This commit is contained in:
parent
cfeda978df
commit
78375aa52f
3 changed files with 46 additions and 8 deletions
|
@ -1519,7 +1519,13 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
|
|||
text = xmlNewText(BAD_CAST(str_val));
|
||||
xmlAddChild(dummy, text);
|
||||
ZVAL_NULL(&data);
|
||||
master_to_zval(&data, attr->encode, dummy);
|
||||
/* TODO: There are other places using dummy nodes -- generalize? */
|
||||
zend_try {
|
||||
master_to_zval(&data, attr->encode, dummy);
|
||||
} zend_catch {
|
||||
xmlFreeNode(dummy);
|
||||
zend_bailout();
|
||||
} zend_end_try();
|
||||
xmlFreeNode(dummy);
|
||||
set_zval_property(ret, attr->name, &data);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue