From 06fa21b0da9a23e81e83e8ed92ea36d319140194 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Thu, 26 Mar 2015 13:15:55 +0000 Subject: [PATCH] Fixup rrset unlock in case of allocation failure. git-svn-id: file:///svn/unbound/trunk@3381 be551aaa-1e26-0410-a405-d3ace91eadb9 --- services/cache/rrset.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/cache/rrset.c b/services/cache/rrset.c index 58f77922a..2c8552953 100644 --- a/services/cache/rrset.c +++ b/services/cache/rrset.c @@ -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; ientry.hash; /* unlock */ -- 2.47.2