From: Dmitry Stogov Date: Wed, 30 Jul 2014 06:39:25 +0000 (+0400) Subject: Fixed usage after free X-Git-Tag: php-5.5.16RC1~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aa3ddda8e504dd2a01e6fa786efda7d3888a9241;p=php Fixed usage after free --- diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index dbab902b26..a0bc76d994 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -979,7 +979,6 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, if (zend_hash_num_elements(&persistent_script->class_table) > 0) { zend_accel_class_hash_copy(CG(class_table), &persistent_script->class_table, NULL TSRMLS_CC); } - free_persistent_script(persistent_script, 0); /* free only hashes */ } #if ZEND_EXTENSION_API_NO >= PHP_5_3_X_API_NO @@ -991,6 +990,10 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, } #endif + if (!from_shared_memory) { + free_persistent_script(persistent_script, 0); /* free only hashes */ + } + return op_array; }