summaryrefslogtreecommitdiff
path: root/ext/opcache
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-07-30 10:40:06 +0400
committerDmitry Stogov <dmitry@zend.com>2014-07-30 10:40:06 +0400
commit43e956a9a1b72dda31f24f1fc9804e19f3391dd4 (patch)
tree31361dc6bf215a138441b88a145c20d32dbe39e2 /ext/opcache
parentf0278589e1583855e04ee04bfe30ccef3e9ccda2 (diff)
parentaa3ddda8e504dd2a01e6fa786efda7d3888a9241 (diff)
downloadphp-git-43e956a9a1b72dda31f24f1fc9804e19f3391dd4.tar.gz
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: Fixed usage after free
Diffstat (limited to 'ext/opcache')
-rw-r--r--ext/opcache/zend_accelerator_util_funcs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c
index 33103e54d1..9311024851 100644
--- a/ext/opcache/zend_accelerator_util_funcs.c
+++ b/ext/opcache/zend_accelerator_util_funcs.c
@@ -1041,7 +1041,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
@@ -1053,6 +1052,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;
}