From: Graham Leggett Date: Tue, 19 Oct 2010 23:02:06 +0000 (+0000) Subject: Avoid unnecessariy initialisation before we test auth_form handler names. X-Git-Tag: 2.3.9~261 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e6a3d2ecf1308dca0ad07fd6ef9be88b710d23d0;p=thirdparty%2Fapache%2Fhttpd.git 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 --- diff --git a/modules/aaa/mod_auth_form.c b/modules/aaa/mod_auth_form.c index 1f499e9c18d..05ac6c26cb8 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);