diff options
| author | Nikita Popov <nikic@php.net> | 2016-07-14 22:29:04 +0200 |
|---|---|---|
| committer | Nikita Popov <nikic@php.net> | 2016-07-16 23:16:34 +0200 |
| commit | cbba1fff3f81bb7c4e6455d2170563e42cca559d (patch) | |
| tree | ae67451916d3963df600cc797dc8731c67b5aee2 /Zend/zend_vm_execute.h | |
| parent | 9452257b046030c32f1b55b75eadcd711e882ad8 (diff) | |
| download | php-git-cbba1fff3f81bb7c4e6455d2170563e42cca559d.tar.gz | |
Fix leak if get_iterator throws but doesn't return NULL
Diffstat (limited to 'Zend/zend_vm_execute.h')
| -rw-r--r-- | Zend/zend_vm_execute.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 5943e4b5c7..3df5217514 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -3511,6 +3511,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CONST_HANDLER( if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) { + if (iter) { + OBJ_RELEASE(&iter->std); + } if (!EG(exception)) { zend_throw_exception_ex(NULL, 0, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name)); } @@ -12571,6 +12574,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_TMP_HANDLER(ZE if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) { zval_ptr_dtor_nogc(free_op1); + if (iter) { + OBJ_RELEASE(&iter->std); + } if (!EG(exception)) { zend_throw_exception_ex(NULL, 0, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name)); } @@ -16157,6 +16163,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_VAR_HANDLER(ZE if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) { zval_ptr_dtor_nogc(free_op1); + if (iter) { + OBJ_RELEASE(&iter->std); + } if (!EG(exception)) { zend_throw_exception_ex(NULL, 0, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name)); } @@ -35267,6 +35276,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CV_HANDLER(ZEN if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) { + if (iter) { + OBJ_RELEASE(&iter->std); + } if (!EG(exception)) { zend_throw_exception_ex(NULL, 0, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name)); } |
