Commit 64092352a47 for php.net
commit 64092352a4773bb2f9521ab336ed41f6f4934d79
Merge: 6e664a04cb8 3b8aac8dad4
Author: ndossche <7771979+ndossche@users.noreply.github.com>
Date: Tue Mar 10 20:29:14 2026 +0100
Merge branch 'PHP-8.5'
* PHP-8.5:
Revert "ext/session: Fix memory leak due to multiple exception happening during session abort"
diff --cc ext/session/session.c
index b9b5bfbb025,489f82d6f14..e790fa074d6
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@@ -1722,29 -1750,36 +1721,21 @@@ PHPAPI php_session_status php_get_sessi
return PS(session_status);
}
-static zend_result php_session_abort(void)
+static bool php_session_abort(void)
{
if (PS(session_status) == php_session_active) {
- if ((PS(mod_data) || PS(mod_user_implemented)) && PS(mod)->s_close) {
- zend_object *old_exception = EG(exception);
- EG(exception) = NULL;
-
+ if (PS(mod_data) || PS(mod_user_implemented)) {
PS(mod)->s_close(&PS(mod_data));
- if (!EG(exception)) {
- EG(exception) = old_exception;
- } else if (old_exception) {
- zend_exception_set_previous(EG(exception), old_exception);
- }
}
PS(session_status) = php_session_none;
- return SUCCESS;
- }
- return FAILURE;
-}
-
-static zend_result php_session_reset(void)
-{
- if (PS(session_status) == php_session_active
- && php_session_initialize() == SUCCESS) {
- return SUCCESS;
+ return true;
}
- return FAILURE;
+ return false;
}
-
-/* This API is not used by any PHP modules including session currently.
- session_adapt_url() may be used to set Session ID to target url without
- starting "URL-Rewriter" output handler. */
-PHPAPI void session_adapt_url(const char *url, size_t url_len, char **new_url, size_t *new_len)
+static bool php_session_reset(void)
{
- if (APPLY_TRANS_SID && (PS(session_status) == php_session_active)) {
- *new_url = php_url_scanner_adapt_single_url(url, url_len, ZSTR_VAL(PS(session_name)), ZSTR_VAL(PS(id)), new_len, true);
- }
+ return PS(session_status) == php_session_active && php_session_initialize() == SUCCESS;
}
/* ********************************