Skip to content

Commit 3073948

Browse files
committed
Revert "ext/session: Fix memory leak due to multiple exception happening during session abort"
This reverts commit 0acde11. The patch is incorrect as described in GH-21200 in the post-merge comments.
1 parent 35d98cb commit 3073948

4 files changed

Lines changed: 1 addition & 51 deletions

File tree

NEWS

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ PHP NEWS
1313
. Fixed preprocessor silently guarding PGSQL_SUPPRESS_TIMESTAMPS support
1414
due to a typo. (KentarouTakeda)
1515

16-
- Session:
17-
. Fix memory leak due to multiple exception happening during session abort.
18-
(arshidkv12)
19-
2016
- SNMP:
2117
. Fixed bug GH-21336 (SNMP::setSecurity() undefined behavior with
2218
NULL arguments). (David Carlier)

ext/session/session.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#include "ext/standard/url_scanner_ex.h"
4242
#include "ext/standard/info.h"
4343
#include "zend_smart_str.h"
44-
#include "zend_exceptions.h"
4544
#include "ext/standard/url.h"
4645
#include "ext/standard/basic_functions.h"
4746
#include "ext/standard/head.h"
@@ -1744,16 +1743,8 @@ PHPAPI php_session_status php_get_session_status(void)
17441743
static zend_result php_session_abort(void) /* {{{ */
17451744
{
17461745
if (PS(session_status) == php_session_active) {
1747-
if ((PS(mod_data) || PS(mod_user_implemented)) && PS(mod)->s_close) {
1748-
zend_object *old_exception = EG(exception);
1749-
EG(exception) = NULL;
1750-
1746+
if (PS(mod_data) || PS(mod_user_implemented)) {
17511747
PS(mod)->s_close(&PS(mod_data));
1752-
if (!EG(exception)) {
1753-
EG(exception) = old_exception;
1754-
} else if (old_exception) {
1755-
zend_exception_set_previous(EG(exception), old_exception);
1756-
}
17571748
}
17581749
PS(session_status) = php_session_none;
17591750
return SUCCESS;

ext/session/tests/sessionhandler_validateid_return_type.phpt

Lines changed: 0 additions & 35 deletions
This file was deleted.

ext/session/tests/user_session_module/session_set_save_handler_class_012.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ var_dump(session_id(), $oldHandler, ini_get('session.save_handler'), $handler->i
4343
--EXPECTF--
4444
*** Testing session_set_save_handler() : incorrect arguments for existing handler open ***
4545
Open:
46-
47-
Warning: SessionHandler::close(): Parent session handler is not open in %s on line %d
4846
SessionHandler::open() expects exactly 2 arguments, 0 given
4947

5048
Warning: Undefined global variable $_SESSION in %s on line %d

0 commit comments

Comments
 (0)