Skip to content

Backport accel_globals->key leak fix (8.3) #18602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions ext/opcache/ZendAccelerator.c
Original file line number Diff line number Diff line change
Expand Up @@ -2937,12 +2937,10 @@ static void accel_globals_ctor(zend_accel_globals *accel_globals)
GC_MAKE_PERSISTENT_LOCAL(accel_globals->key);
}

#ifdef ZTS
static void accel_globals_dtor(zend_accel_globals *accel_globals)
{
zend_string_free(accel_globals->key);
}
#endif

#ifdef HAVE_HUGE_CODE_PAGES
# ifndef _WIN32
Expand Down Expand Up @@ -3384,6 +3382,8 @@ void accel_shutdown(void)
if (!ZCG(enabled) || !accel_startup_ok) {
#ifdef ZTS
ts_free_id(accel_globals_id);
#else
accel_globals_dtor(&accel_globals);
#endif
return;
}
Expand All @@ -3398,6 +3398,8 @@ void accel_shutdown(void)

#ifdef ZTS
ts_free_id(accel_globals_id);
#else
accel_globals_dtor(&accel_globals);
#endif

if (!_file_cache_only) {
Expand Down
Loading