From 14660031fc7c215e8b8248650a60dc8d34b9914b Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 16 Dec 2003 20:20:09 +0000 Subject: [PATCH] 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 --- modules/experimental/util_ldap_cache_mgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.50.1