From 77428f1a22e9be3d0488138ec1e3e37ffe7ea805 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Fri, 27 Jun 2008 22:00:08 +0000 Subject: Fix crashes when we cannot create a lock. --- apache2x/mod_httpauth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apache2x/mod_httpauth.c b/apache2x/mod_httpauth.c index 58e6f2e..aac94eb 100644 --- a/apache2x/mod_httpauth.c +++ b/apache2x/mod_httpauth.c @@ -158,7 +158,7 @@ httpauth_initialize (apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_ rc = apr_global_mutex_create (&shared_lock, lock_name, APR_LOCK_DEFAULT, p); if (rc != APR_SUCCESS) ap_log_error (APLOG_MARK, APLOG_ERR, rc, s, - "httpauth: couldn't create shared memory lock"); + "httpauth: couldn't create shared memory lock: %s", lock_name); } if (file != NULL) @@ -190,7 +190,7 @@ shared_get_if_changed (httpauth_context_t *ctx, int version, httpauth_shared_t * httpauth_shared_t *block; int ret = 0; - if (!ctx->shared_block) + if (!ctx->shared_block || !shared_lock) return 0; apr_global_mutex_lock (shared_lock); @@ -212,7 +212,7 @@ shared_set_if_changed (httpauth_context_t *ctx, httpauth_shared_t *shared) { httpauth_shared_t *block; - if (!ctx->shared_block) + if (!ctx->shared_block || !shared_lock) return; apr_global_mutex_lock (shared_lock); -- cgit v1.2.3