[php-src] PR #23064: Fix GH-23061: SessionHandler::create_sid() failure leaks memory in debug build

From: Date: Wed, 05 Aug 2026 10:58:22 +0000
Subject: [php-src] PR #23064: Fix GH-23061: SessionHandler::create_sid() failure leaks memory in debug build
Groups: php.git-pulls 
Request: Send a blank email to git-pulls+get-37551@lists.php.net to get a copy of this message
Pull Request: https://github.com/php/php-src/pull/23064 Author: lazerg When a save handler extending SessionHandler throws while the session is starting, php_session_abort() calls the user close callback, but zend_call_function() refuses to run userland code while an exception is pending. SessionHandler::close() therefore never runs, and the default handler that SessionHandler::open() opened stays open, so its mod_data is never freed. A debug build reports it as two leaks. Since PS(mod_user_is_open) already tracks whether the default handler is open, request shutdown can close it when the user handler did not. This also covers a handler that overrides close() without calling parent::close(), which leaked the same way. Fixes GH-23061

« previous php.git-pulls (#37551) next »