From 7421acfc907593e4a807e64bf0abdd67140cd02e Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 29 Jan 2016 15:18:59 +0100 Subject: [PATCH] fix wrong gc sequence --- ext/session/session.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ext/session/session.c b/ext/session/session.c index 52ba7e300a..d67045ed89 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -543,9 +543,6 @@ static void php_session_initialize(void) /* {{{ */ php_session_reset_id(); PS(session_status) = php_session_active; - /* GC must be done before read */ - php_session_gc(); - /* Read data */ php_session_track_init(); if (PS(mod)->s_read(&PS(mod_data), PS(id), &val, PS(gc_maxlifetime)) == FAILURE) { @@ -555,6 +552,10 @@ static void php_session_initialize(void) /* {{{ */ php_error_docref(NULL, E_NOTICE, "Failed to read session data: %s (path: %s)", PS(mod)->s_name, PS(save_path)); */ } + + /* GC must be done after read */ + php_session_gc(); + if (PS(session_vars)) { zend_string_release(PS(session_vars)); PS(session_vars) = NULL; -- 2.40.0