From: Jeff Trawick Date: Fri, 7 Nov 2003 10:49:35 +0000 (+0000) Subject: fix another segfault condition in ldap cache code X-Git-Tag: pre_ajp_proxy~1063 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5552b336d2dda29e5511e83784b75ed45189837;p=thirdparty%2Fapache%2Fhttpd.git fix another segfault condition in ldap cache code PR: 18756 Submitted by: Matthieu Estrade Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101712 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/experimental/util_ldap_cache_mgr.c b/modules/experimental/util_ldap_cache_mgr.c index 0f37dfa022a..9cc281e3036 100644 --- a/modules/experimental/util_ldap_cache_mgr.c +++ b/modules/experimental/util_ldap_cache_mgr.c @@ -398,9 +398,11 @@ void util_ald_cache_insert(util_ald_cache_t *cache, void *payload) if (cache == NULL || payload == NULL) return; + if ((node = (util_cache_node_t *)util_ald_alloc(cache->rmm_addr, sizeof(util_cache_node_t))) == NULL) + return; + cache->inserts++; hashval = (*cache->hash)(payload) % cache->size; - node = (util_cache_node_t *)util_ald_alloc(cache->rmm_addr, sizeof(util_cache_node_t)); node->add_time = apr_time_now(); node->payload = (*cache->copy)(cache, payload); node->next = cache->nodes[hashval];