From 549cf0381ae0109b44655e84df15b2f86d5f815f Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Tue, 18 Jan 2000 22:18:17 +0000 Subject: [PATCH] Leak fix --- Zend/zend_execute.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index ac48ac6780..2e30fc170b 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -327,6 +327,9 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2 SELECTIVE_PZVAL_LOCK(*Ts[result->u.var].var.ptr_ptr, result); AI_USE_PTR(Ts[result->u.var].var); } + if (type==IS_TMP_VAR) { + zval_dtor(value); + } return; } @@ -343,7 +346,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2 variable_ptr->is_ref = 1; if (type!=IS_TMP_VAR) { zendi_zval_copy_ctor(*variable_ptr); - zval_ptr_dtor(&value); + } } } else { @@ -570,13 +573,14 @@ fetch_string_dim: break; case IS_DOUBLE: case IS_RESOURCE: + case IS_BOOL: case IS_LONG: { long index; - if (dim->type == IS_LONG || dim->type == IS_RESOURCE) { - index = dim->value.lval; - } else { + if (dim->type == IS_DOUBLE) { index = (long)dim->value.dval; + } else { + index = dim->value.lval; } if (zend_hash_index_find(ht, index, (void **) &retval) == FAILURE) { switch (type) { -- 2.40.0