]> granicus.if.org Git - php/commitdiff
Make sure closing save handler.
authorYasuo Ohgaki <yohgaki@php.net>
Sun, 6 Sep 2015 19:45:20 +0000 (04:45 +0900)
committerYasuo Ohgaki <yohgaki@php.net>
Sun, 6 Sep 2015 19:55:08 +0000 (04:55 +0900)
ext/session/session.c

index 8c604631aa0c82fa97240736967cf6d76a7bb63b..be86dcae7fe9a64536a92a766c6c1694954fbe33 100644 (file)
@@ -2052,13 +2052,14 @@ static PHP_FUNCTION(session_regenerate_id)
                } else {
                        ret = PS(mod)->s_write(&PS(mod_data), PS(id), ZSTR_EMPTY_ALLOC(), PS(gc_maxlifetime));
                }
-               PS(mod)->s_close(&PS(mod_data));
                if (ret == FAILURE) {
+                       PS(mod)->s_close(&PS(mod_data));
                        PS(session_status) = php_session_none;
                        php_error_docref(NULL, E_WARNING, "Session write failed. ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
                        RETURN_FALSE;
                }
        }
+       PS(mod)->s_close(&PS(mod_data));
 
        /* New session data */
        if (PS(session_vars)) {