]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Fixup rrset unlock in case of allocation failure.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 26 Mar 2015 13:15:55 +0000 (13:15 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 26 Mar 2015 13:15:55 +0000 (13:15 +0000)
git-svn-id: file:///svn/unbound/trunk@3381 be551aaa-1e26-0410-a405-d3ace91eadb9

services/cache/rrset.c

index 58f77922af2434933b9009c352193cd1a7f6a09a..2c855295387136636c2641f11634a364b83980a3 100644 (file)
@@ -305,9 +305,10 @@ rrset_array_unlock_touch(struct rrset_cache* r, struct regional* scratch,
        hashvalue_t* h;
        size_t i;
        if(count > RR_COUNT_MAX || !(h = (hashvalue_t*)regional_alloc(scratch, 
-               sizeof(hashvalue_t)*count)))
+               sizeof(hashvalue_t)*count))) {
                log_warn("rrset LRU: memory allocation failed");
-       else    /* store hash values */
+               h = NULL;
+       } else  /* store hash values */
                for(i=0; i<count; i++)
                        h[i] = ref[i].key->entry.hash;
        /* unlock */