Skip to content

Commit f8ff8f2

Browse files
committed
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.
1 parent a96f6ff commit f8ff8f2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

main/SAPI.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,9 +521,12 @@ SAPI_API void sapi_deactivate_module(void)
521521
}
522522
if (SG(request_info).content_type_dup) {
523523
efree(SG(request_info).content_type_dup);
524+
SG(request_info).content_type_dup = NULL;
524525
}
525526
if (SG(request_info).current_user) {
526527
efree(SG(request_info).current_user);
528+
SG(request_info).current_user = NULL;
529+
SG(request_info).current_user_length = 0;
527530
}
528531
if (sapi_module.deactivate) {
529532
sapi_module.deactivate();

0 commit comments

Comments
 (0)