Skip to content

Commit 3a760c7

Browse files
committed
SAPI: clear current_user and content_type_dup after releasing them
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
1 parent fbdf959 commit 3a760c7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

main/SAPI.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,9 +495,11 @@ SAPI_API void sapi_deactivate_module(void)
495495
}
496496
if (SG(request_info).content_type_dup) {
497497
efree(SG(request_info).content_type_dup);
498+
SG(request_info).content_type_dup = NULL;
498499
}
499500
if (SG(request_info).current_user) {
500501
zend_string_release_ex(SG(request_info).current_user, false);
502+
SG(request_info).current_user = NULL;
501503
}
502504
if (sapi_module.deactivate) {
503505
sapi_module.deactivate();

0 commit comments

Comments
 (0)