mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fixed bug #52041 (Memory leak when writing on uninitialized variable returned from function)
This commit is contained in:
parent
2f838ef547
commit
d868733cc3
4 changed files with 111 additions and 1 deletions
|
@ -1548,8 +1548,13 @@ static zval *to_zval_object_ex(encodeTypePtr type, xmlNodePtr data, zend_class_e
|
|||
}
|
||||
model_to_zval_object(ret, sdlType->model, data, sdl TSRMLS_CC);
|
||||
if (redo_any) {
|
||||
if (get_zval_property(ret, "any" TSRMLS_CC) == NULL) {
|
||||
zval *tmp = get_zval_property(ret, "any" TSRMLS_CC);
|
||||
|
||||
if (tmp == NULL) {
|
||||
model_to_zval_any(ret, data->children TSRMLS_CC);
|
||||
} else if (Z_REFCOUNT_P(tmp) == 0) {
|
||||
zval_dtor(tmp);
|
||||
efree(tmp);
|
||||
}
|
||||
zval_ptr_dtor(&redo_any);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue