mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-01-07 15:29:36 -05:00
Fixup rrset unlock in case of allocation failure.
git-svn-id: file:///svn/unbound/trunk@3381 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
b2bdce46be
commit
06fa21b0da
1 changed files with 3 additions and 2 deletions
5
services/cache/rrset.c
vendored
5
services/cache/rrset.c
vendored
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Reference in a new issue