]> granicus.if.org Git - apache/commitdiff
Avoid unnecessariy initialisation before we test auth_form handler names.
authorGraham Leggett <minfrin@apache.org>
Tue, 19 Oct 2010 23:02:06 +0000 (23:02 +0000)
committerGraham Leggett <minfrin@apache.org>
Tue, 19 Oct 2010 23:02:06 +0000 (23:02 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1024456 13f79535-47bb-0310-9956-ffa450edef68

modules/aaa/mod_auth_form.c

index 1f499e9c18d056bb6ed7a4e77dd2b102f8557289..05ac6c26cb89266f5277f67c75d476fa3ab6bdd9 100644 (file)
@@ -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);