From: Graham Leggett Date: Sun, 19 Sep 2004 23:11:10 +0000 (+0000) Subject: Fix the global mutex crash when the global mutex is never allocated due X-Git-Tag: 2.1.1~237 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b611143e420112e5d02a0bd0346b927f19813177;p=thirdparty%2Fapache%2Fhttpd.git Fix the global mutex crash when the global mutex is never allocated due to disabled/empty caches. PR: Obtained from: Submitted by: Jess Holle Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105208 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index f13a41bc7ef..dbed042fe5c 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.1.0-dev [Remove entries to the current 2.0 section below, when backported] + *) Fix the global mutex crash when the global mutex is never allocated due + to disabled/empty caches. [Jess Holle ] + *) Fix a segfault in the LDAP cache purge. [Jess Holle ] *) mod_rewrite: Handle per-location rules when r->filename is unset. diff --git a/modules/ldap/util_ldap.c b/modules/ldap/util_ldap.c index 3258c714118..238ad28e691 100644 --- a/modules/ldap/util_ldap.c +++ b/modules/ldap/util_ldap.c @@ -89,9 +89,11 @@ void *util_ldap_create_config(apr_pool_t *p, server_rec *s); #endif #define LDAP_CACHE_LOCK() \ - apr_global_mutex_lock(st->util_ldap_cache_lock) + if (st->util_ldap_cache_lock) \ + apr_global_mutex_lock(st->util_ldap_cache_lock) #define LDAP_CACHE_UNLOCK() \ - apr_global_mutex_unlock(st->util_ldap_cache_lock) + if (st->util_ldap_cache_lock) \ + apr_global_mutex_unlock(st->util_ldap_cache_lock) static void util_ldap_strdup (char **str, const char *newstr)