diff options
Diffstat (limited to 'Zend/zend_variables.c')
-rw-r--r-- | Zend/zend_variables.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c index 51f51f8d8c..e6fbd5342c 100644 --- a/Zend/zend_variables.c +++ b/Zend/zend_variables.c @@ -140,14 +140,16 @@ ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC) case IS_CONSTANT_ARRAY: { zval *tmp; HashTable *original_ht = zvalue->value.ht; + HashTable *tmp_ht = NULL; TSRMLS_FETCH(); if (zvalue->value.ht == &EG(symbol_table)) { return SUCCESS; /* do nothing */ } - ALLOC_HASHTABLE_REL(zvalue->value.ht); - zend_hash_init(zvalue->value.ht, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(zvalue->value.ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); + ALLOC_HASHTABLE_REL(tmp_ht); + zend_hash_init(tmp_ht, 0, NULL, ZVAL_PTR_DTOR, 0); + zend_hash_copy(tmp_ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); + zvalue->value.ht = tmp_ht; } break; case IS_OBJECT: |