Skip to content

Commit aa3ddda

Browse files
committed
Fixed usage after free
1 parent ab4c4c3 commit aa3ddda

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ext/opcache/zend_accelerator_util_funcs.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,6 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script,
979979
if (zend_hash_num_elements(&persistent_script->class_table) > 0) {
980980
zend_accel_class_hash_copy(CG(class_table), &persistent_script->class_table, NULL TSRMLS_CC);
981981
}
982-
free_persistent_script(persistent_script, 0); /* free only hashes */
983982
}
984983

985984
#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,
991990
}
992991
#endif
993992

993+
if (!from_shared_memory) {
994+
free_persistent_script(persistent_script, 0); /* free only hashes */
995+
}
996+
994997
return op_array;
995998
}
996999

0 commit comments

Comments
 (0)