summaryrefslogtreecommitdiff
path: root/apache2x/mod_httpauth.c
diff options
context:
space:
mode:
Diffstat (limited to 'apache2x/mod_httpauth.c')
-rw-r--r--apache2x/mod_httpauth.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/apache2x/mod_httpauth.c b/apache2x/mod_httpauth.c
index aac94eb..248dff5 100644
--- a/apache2x/mod_httpauth.c
+++ b/apache2x/mod_httpauth.c
@@ -154,6 +154,9 @@ httpauth_initialize (apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_
"httpauth: couldn't create temporary file: %s", lock_name);
}
+ if (file != NULL)
+ apr_file_close (file);
+
if (rc == APR_SUCCESS) {
rc = apr_global_mutex_create (&shared_lock, lock_name, APR_LOCK_DEFAULT, p);
if (rc != APR_SUCCESS)
@@ -161,9 +164,8 @@ httpauth_initialize (apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_
"httpauth: couldn't create shared memory lock: %s", lock_name);
}
- if (file != NULL)
- apr_file_close (file);
- shared_lock_name = lock_name;
+ if (rc == APR_SUCCESS)
+ shared_lock_name = lock_name;
return OK;
}
@@ -173,13 +175,13 @@ httpauth_child (apr_pool_t *p, server_rec *s)
{
apr_status_t rc;
- if (!shared_lock)
+ if (!shared_lock || !shared_lock_name)
return;
rc = apr_global_mutex_child_init (&shared_lock, shared_lock_name, p);
if (rc != APR_SUCCESS) {
ap_log_error (APLOG_MARK, APLOG_ERR, rc, s,
- "httpauth: couldn't create lock for shared memory in child");
+ "httpauth: couldn't create lock for shared memory in child: %s", shared_lock_name);
shared_lock = NULL;
}
}