From a0a1c8990ede33b2d5b7976f1a19a82aaa226fcb Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 17 Oct 2018 17:44:03 +0300 Subject: [PATCH] Fixed incorrect reallocation --- ext/opcache/zend_accelerator_util_funcs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index acec571f4df..ce9f025b991 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -178,7 +178,9 @@ static void zend_hash_clone_methods(HashTable *ht, HashTable *source, zend_class new_entry->prototype = ARENA_REALLOC(new_entry->prototype); } } - ZEND_MAP_PTR_INIT(new_entry->run_time_cache, ARENA_REALLOC(ZEND_MAP_PTR(new_entry->run_time_cache))); + if (IN_ARENA(ZEND_MAP_PTR(new_entry->run_time_cache))) { + ZEND_MAP_PTR_INIT(new_entry->run_time_cache, ARENA_REALLOC(ZEND_MAP_PTR(new_entry->run_time_cache))); + } ZEND_MAP_PTR_INIT(new_entry->static_variables_ptr, &new_entry->static_variables); } }