]> granicus.if.org Git - apache/commitdiff
Fix segfault triggered when the malloc() in find_entry() fails.
authorBill Stoddard <stoddard@apache.org>
Fri, 10 May 2002 17:15:35 +0000 (17:15 +0000)
committerBill Stoddard <stoddard@apache.org>
Fri, 10 May 2002 17:15:35 +0000 (17:15 +0000)
Patch submitted by "Jean-Jacques Clar" <JJCLAR@novell.com>

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95034 13f79535-47bb-0310-9956-ffa450edef68

modules/experimental/cache_hash.c

index d74d2fe0fe4a127350a44033874d40d250eff1a8..bf0c2b13761849d55817a0590aa36fdce84f5691 100644 (file)
@@ -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;