]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Avoid unnecessariy initialisation before we test ldap-status handler name.
authorGraham Leggett <minfrin@apache.org>
Tue, 19 Oct 2010 22:53:41 +0000 (22:53 +0000)
committerGraham Leggett <minfrin@apache.org>
Tue, 19 Oct 2010 22:53:41 +0000 (22:53 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1024453 13f79535-47bb-0310-9956-ffa450edef68

modules/ldap/util_ldap.c

index 95a88be3ed8a2ab017be3ac02c97798247faee45..6f485b5a00039d458ba4a27eece6a974c44f87f8 100644 (file)
@@ -104,18 +104,20 @@ static void util_ldap_strdup (char **str, const char *newstr)
  */
 static int util_ldap_handler(request_rec *r)
 {
-    util_ldap_state_t *st = (util_ldap_state_t *)
-                            ap_get_module_config(r->server->module_config,
-                                                 &ldap_module);
+    util_ldap_state_t *st;
 
     r->allowed |= (1 << M_GET);
-    if (r->method_number != M_GET)
+    if (r->method_number != M_GET) {
         return DECLINED;
+    }
 
     if (strcmp(r->handler, "ldap-status")) {
         return DECLINED;
     }
 
+    st = (util_ldap_state_t *) ap_get_module_config(r->server->module_config,
+            &ldap_module);
+
     ap_set_content_type(r, "text/html; charset=ISO-8859-1");
 
     if (r->header_only)