From: Anatol Belski Date: Fri, 29 Jan 2016 14:18:59 +0000 (+0100) Subject: fix wrong gc sequence X-Git-Tag: php-7.2.0alpha1~620^2~50^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d2c752d7e9134c0db1045d3ee244c5d1ee4eaba9;p=php fix wrong gc sequence --- 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;