summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>1999-08-23 19:02:28 +0000
committerAndi Gutmans <andi@php.net>1999-08-23 19:02:28 +0000
commit48a8b14a47f18c2143c0ad200e0c85db37a90db6 (patch)
tree01725406536c01f36ddbf78e277a5b4c3f6f39e9
parent196b2350f4204c9ad67d7191ba89c9e2405fbc30 (diff)
downloadphp-git-48a8b14a47f18c2143c0ad200e0c85db37a90db6.tar.gz
- Fixed a specific memory leak linked to locking.
-rw-r--r--Zend/zend_execute.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index dd3b07b38b..a55313f95d 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -321,6 +321,16 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
if (variable_ptr->refcount==0) {
switch (type) {
case IS_VAR:
+ if (PZVAL_IS_LOCKED(value)) {
+ zval *orig_value = value;
+
+ value = (zval *) emalloc(sizeof(zval));
+ *value = *orig_value;
+ value->refcount=0;
+ value->EA.locks = 0;
+ zval_copy_ctor(value);
+ }
+ /* break missing intentionally */
case IS_CONST:
if (variable_ptr==value) {
variable_ptr->refcount++;
@@ -352,6 +362,16 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
} else { /* we need to split */
switch (type) {
case IS_VAR:
+ if (PZVAL_IS_LOCKED(value)) {
+ zval *orig_value = value;
+
+ value = (zval *) emalloc(sizeof(zval));
+ *value = *orig_value;
+ value->refcount=0;
+ value->EA.locks = 0;
+ zval_copy_ctor(value);
+ }
+ /* break missing intentionally */
case IS_CONST:
if (PZVAL_IS_REF(value)) {
variable_ptr = *variable_ptr_ptr = (zval *) emalloc(sizeof(zval));