From: Bill Stoddard Date: Fri, 10 May 2002 17:15:35 +0000 (+0000) Subject: Fix segfault triggered when the malloc() in find_entry() fails. X-Git-Tag: 2.0.37~435 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b603af85900edbd5b77a0643f3fc518d825fb385;p=apache 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 --- 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;