Skip to content

Commit bd6ddcf

Browse files
authored
Fix leak of accel_shared_globals for file_cache_only (GH-16517)
If `opcache.file_cache_only` is enabled, `accel_shared_globals` is allocated as true global, and we need to free that memory when we shut down the accelerator.
1 parent c2459d8 commit bd6ddcf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3408,6 +3408,8 @@ void accel_shutdown(void)
34083408
/* Delay SHM detach */
34093409
orig_post_shutdown_cb = zend_post_shutdown_cb;
34103410
zend_post_shutdown_cb = accel_post_shutdown;
3411+
} else {
3412+
free(accel_shared_globals);
34113413
}
34123414

34133415
zend_compile_file = accelerator_orig_compile_file;

0 commit comments

Comments
 (0)