From aa352a34fd1077995ec159ba30a6cf62c70e64c7 Mon Sep 17 00:00:00 2001 From: Yasuo Ohgaki Date: Mon, 7 Sep 2015 04:45:20 +0900 Subject: [PATCH] Make sure closing save handler. --- ext/session/session.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/session/session.c b/ext/session/session.c index 8c604631aa..be86dcae7f 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -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)) { -- 2.40.0