From b603af85900edbd5b77a0643f3fc518d825fb385 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 10 May 2002 17:15:35 +0000 Subject: [PATCH] Fix segfault triggered when the malloc() in find_entry() fails. Patch submitted by "Jean-Jacques Clar" git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95034 13f79535-47bb-0310-9956-ffa450edef68 --- modules/experimental/cache_hash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/experimental/cache_hash.c b/modules/experimental/cache_hash.c index d74d2fe0fe..bf0c2b1376 100644 --- a/modules/experimental/cache_hash.c +++ b/modules/experimental/cache_hash.c @@ -293,7 +293,8 @@ CACHE_DECLARE(void *) cache_hash_set(cache_hash_t *ht, cache_hash_entry_t **hep, *tmp; const void *tval; hep = find_entry(ht, key, klen, val); - if (*hep) { + /* If hep == NULL, then the malloc() in find_entry failed */ + if (hep && *hep) { if (!val) { /* delete entry */ tval = (*hep)->val; -- 2.40.0