From db3bf715e0d5719646485e8390c71f487e33433a Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 18 May 2025 19:50:30 +0200 Subject: [PATCH] Fix leak of accel_globals->key I don't know why this was guarded with ZTS, but it leaks on this test (and a few more): `./sapi/cli/php ./run-tests.php -c . --show-diff sapi/phpdbg/tests/stdin_001.phpt` Closes GH-18593. --- NEWS | 1 + ext/opcache/ZendAccelerator.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/NEWS b/NEWS index c8c88984cb1..44d7b87e6ca 100644 --- a/NEWS +++ b/NEWS @@ -43,6 +43,7 @@ PHP NEWS failure). (nielsdos) . Fixed bug GH-18534 (FPM exit code 70 with enabled opcache and hooked properties in traits). (nielsdos) + . Fix leak of accel_globals->key. (nielsdos) - SPL: . Fixed bug GH-18421 (Integer overflow with large numbers in LimitIterator). diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 249ade2a7ae..82ae1adce44 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -2964,9 +2964,7 @@ static void accel_globals_ctor(zend_accel_globals *accel_globals) static void accel_globals_dtor(zend_accel_globals *accel_globals) { -#ifdef ZTS zend_string_free(accel_globals->key); -#endif if (accel_globals->preloaded_internal_run_time_cache) { pefree(accel_globals->preloaded_internal_run_time_cache, 1); }