From 063c6b713c84fe95e8631d7c3552eb07c9620040 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Fri, 31 Jul 2026 08:21:19 -0400 Subject: [PATCH] SAPI: clear current_user and content_type_dup after releasing them sapi_deactivate_module() frees both without resetting the pointer, unlike the auth_user, auth_password and auth_digest fields next to them. Nothing reads them between the free and the next sapi_activate() today, so this is consistency rather than a live bug. Closes GH-22974 --- main/SAPI.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main/SAPI.c b/main/SAPI.c index 2efce069da9d..40d3e20fdc96 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -521,9 +521,12 @@ 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) { efree(SG(request_info).current_user); + SG(request_info).current_user = NULL; + SG(request_info).current_user_length = 0; } if (sapi_module.deactivate) { sapi_module.deactivate();