From: Bradley Nicholes Date: Tue, 16 Dec 2003 20:20:09 +0000 (+0000) Subject: Fix the initial cache structure allocation. Since we are calling util_ald_create_cac... X-Git-Tag: pre_ajp_proxy~914 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=14660031fc7c215e8b8248650a60dc8d34b9914b;p=apache Fix the initial cache structure allocation. Since we are calling util_ald_create_cache() to create a util_ald_cache_t structure, we can't use util_ald_alloc() to alloc the memory because we don't have a structure to allocate from yet. Submitted by: Matthieu Estrade [apache@moresecurity.org] Reviewed by: Brad Nicholes git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102073 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/experimental/util_ldap_cache_mgr.c b/modules/experimental/util_ldap_cache_mgr.c index 1046dc6c0f..4deafe61e9 100644 --- a/modules/experimental/util_ldap_cache_mgr.c +++ b/modules/experimental/util_ldap_cache_mgr.c @@ -301,9 +301,9 @@ util_ald_cache_t *util_ald_create_cache(util_ldap_state_t *st, return NULL; #if APR_HAS_SHARED_MEMORY - cache = (util_ald_cache_t *)util_ald_alloc(st->cache_rmm, sizeof(util_ald_cache_t)); + cache = (util_ald_cache_t *)apr_rmm_addr_get(st->cache_rmm, apr_rmm_calloc(st->cache_rmm, sizeof(util_ald_cache_t))); #else - cache = (util_ald_cache_t *)util_ald_alloc(NULL, sizeof(util_ald_cache_t)); + cache = (util_ald_cache_t *)calloc(sizeof(util_ald_cache_t), 1); #endif if (!cache) return NULL;