From e6a3d2ecf1308dca0ad07fd6ef9be88b710d23d0 Mon Sep 17 00:00:00 2001 From: Graham Leggett <minfrin@apache.org> Date: Tue, 19 Oct 2010 23:02:06 +0000 Subject: [PATCH] Avoid unnecessariy initialisation before we test auth_form handler names. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1024456 13f79535-47bb-0310-9956-ffa450edef68 --- modules/aaa/mod_auth_form.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/aaa/mod_auth_form.c b/modules/aaa/mod_auth_form.c index 1f499e9c18..05ac6c26cb 100644 --- a/modules/aaa/mod_auth_form.c +++ b/modules/aaa/mod_auth_form.c @@ -1063,9 +1063,7 @@ static int authenticate_form_authn(request_rec * r) */ static int authenticate_form_login_handler(request_rec * r) { - - auth_form_config_rec *conf = ap_get_module_config(r->per_dir_config, - &auth_form_module); + auth_form_config_rec *conf; const char *sent_user = NULL, *sent_pw = NULL, *sent_loc = NULL; int rv; @@ -1081,6 +1079,8 @@ static int authenticate_form_login_handler(request_rec * r) return HTTP_METHOD_NOT_ALLOWED; } + conf = ap_get_module_config(r->per_dir_config, &auth_form_module); + rv = get_form_auth(r, conf->username, conf->password, conf->location, NULL, NULL, NULL, &sent_user, &sent_pw, &sent_loc, @@ -1124,14 +1124,14 @@ static int authenticate_form_login_handler(request_rec * r) */ static int authenticate_form_logout_handler(request_rec * r) { - - auth_form_config_rec *conf = ap_get_module_config(r->per_dir_config, - &auth_form_module); + auth_form_config_rec *conf; if (strcmp(r->handler, FORM_LOGOUT_HANDLER)) { return DECLINED; } + conf = ap_get_module_config(r->per_dir_config, &auth_form_module); + /* remove the username and password, effectively logging the user out */ set_session_auth(r, NULL, NULL, NULL); -- 2.40.0