Skip to content

Commit 43e956a

Browse files
committed
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: Fixed usage after free
2 parents f027858 + aa3ddda commit 43e956a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ext/opcache/zend_accelerator_util_funcs.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,6 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script,
10411041
if (zend_hash_num_elements(&persistent_script->class_table) > 0) {
10421042
zend_accel_class_hash_copy(CG(class_table), &persistent_script->class_table, NULL TSRMLS_CC);
10431043
}
1044-
free_persistent_script(persistent_script, 0); /* free only hashes */
10451044
}
10461045

10471046
#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,
10531052
}
10541053
#endif
10551054

1055+
if (!from_shared_memory) {
1056+
free_persistent_script(persistent_script, 0); /* free only hashes */
1057+
}
1058+
10561059
return op_array;
10571060
}
10581061

0 commit comments

Comments
 (0)