summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-08-20 10:43:37 +0400
committerDmitry Stogov <dmitry@zend.com>2014-08-20 10:43:37 +0400
commit8ea7e4e4e2b137fa3d9e4338e31ab0b752404a0d (patch)
treea2b5ac6ec225246a3a35678101a96b1009237368
parent285934a4c9f18788e3561d0b2f284de439a9ab75 (diff)
downloadphp-git-8ea7e4e4e2b137fa3d9e4338e31ab0b752404a0d.tar.gz
fixed memory leak
-rw-r--r--Zend/zend_vm_def.h3
-rw-r--r--Zend/zend_vm_execute.h12
2 files changed, 15 insertions, 0 deletions
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 34e317c9c0..c71a0b7ed3 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -4551,6 +4551,9 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
(Z_ISREF_P(array_ref) &&
Z_REFCOUNTED_P(array_ptr) &&
Z_REFCOUNT_P(array_ptr) > 1)) {
+ if (!Z_IMMUTABLE_P(array_ptr)) {
+ Z_DELREF_P(array_ptr);
+ }
zval_copy_ctor(array_ptr);
}
Z_ADDREF_P(array_ref);
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index ad879ed777..40dab7a2d2 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -3165,6 +3165,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
(Z_ISREF_P(array_ref) &&
Z_REFCOUNTED_P(array_ptr) &&
Z_REFCOUNT_P(array_ptr) > 1)) {
+ if (!Z_IMMUTABLE_P(array_ptr)) {
+ Z_DELREF_P(array_ptr);
+ }
zval_copy_ctor(array_ptr);
}
Z_ADDREF_P(array_ref);
@@ -8685,6 +8688,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
(Z_ISREF_P(array_ref) &&
Z_REFCOUNTED_P(array_ptr) &&
Z_REFCOUNT_P(array_ptr) > 1)) {
+ if (!Z_IMMUTABLE_P(array_ptr)) {
+ Z_DELREF_P(array_ptr);
+ }
zval_copy_ctor(array_ptr);
}
Z_ADDREF_P(array_ref);
@@ -14128,6 +14134,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
(Z_ISREF_P(array_ref) &&
Z_REFCOUNTED_P(array_ptr) &&
Z_REFCOUNT_P(array_ptr) > 1)) {
+ if (!Z_IMMUTABLE_P(array_ptr)) {
+ Z_DELREF_P(array_ptr);
+ }
zval_copy_ctor(array_ptr);
}
Z_ADDREF_P(array_ref);
@@ -31489,6 +31498,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
(Z_ISREF_P(array_ref) &&
Z_REFCOUNTED_P(array_ptr) &&
Z_REFCOUNT_P(array_ptr) > 1)) {
+ if (!Z_IMMUTABLE_P(array_ptr)) {
+ Z_DELREF_P(array_ptr);
+ }
zval_copy_ctor(array_ptr);
}
Z_ADDREF_P(array_ref);