[php-src] master: SAPI: clear current_user and content_type_dup after releasing them (#22974)

From: Date: Fri, 07 Aug 2026 11:32:48 +0000
Subject: [php-src] master: SAPI: clear current_user and content_type_dup after releasing them (#22974)
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-140524@lists.php.net to get a copy of this message
Author: Ilia Alshanetsky (iliaal) Committer: GitHub (web-flow) Pusher: Girgias Date: 2026-08-07T12:32:45+01:00 Commit: https://github.com/php/php-src/commit/642fa8c93bf825fb98b3999cbd94f904548fef8a Raw diff: https://github.com/php/php-src/commit/642fa8c93bf825fb98b3999cbd94f904548fef8a.diff SAPI: clear current_user and content_type_dup after releasing them (#22974) sapi_deactivate_module() releases both without resetting the pointer, unlike the auth_user, auth_password and auth_digest fields next to them. Nothing reads them between the release and the next sapi_activate() today, so this is consistency rather than a live bug. Closes GH-22974 Changed paths: M main/SAPI.c Diff: diff --git a/main/SAPI.c b/main/SAPI.c index 3daa88e07f25..7de36af440c3 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -495,9 +495,11 @@ SAPI_API void sapi_deactivate_module(void) } if (SG(request_info).content_type_dup) { efree(SG(request_info).content_type_dup); + SG(request_info).content_type_dup = NULL; } if (SG(request_info).current_user) { zend_string_release_ex(SG(request_info).current_user, false); + SG(request_info).current_user = NULL; } if (sapi_module.deactivate) { sapi_module.deactivate();

« previous php.cvs (#140524) next »