From: Wouter Wijngaards Date: Fri, 6 Jan 2017 15:50:39 +0000 (+0000) Subject: - Fix #1201: Fix missing unlock in answer_from_cache error condition. X-Git-Tag: release-1.6.1rc1~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5431ca7e58fcb93135b3d5f103cdb1e83dadaa8;p=thirdparty%2Funbound.git - Fix #1201: Fix missing unlock in answer_from_cache error condition. git-svn-id: file:///svn/unbound/trunk@3983 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/daemon/worker.c b/daemon/worker.c index b0c1acf93..6b2b4b1e3 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -566,7 +566,7 @@ answer_from_cache(struct worker* worker, struct query_info* qinfo, edns->bits &= EDNS_DO; if(!inplace_cb_reply_servfail_call(&worker->env, qinfo, NULL, rep, LDNS_RCODE_SERVFAIL, edns, worker->scratchpad)) - return 0; + goto bail_out; error_encode(repinfo->c->buffer, LDNS_RCODE_SERVFAIL, qinfo, id, flags, edns); rrset_array_unlock_touch(worker->env.rrset_cache, @@ -599,7 +599,7 @@ answer_from_cache(struct worker* worker, struct query_info* qinfo, edns->bits &= EDNS_DO; if(!inplace_cb_reply_cache_call(&worker->env, qinfo, NULL, rep, (int)(flags&LDNS_RCODE_MASK), edns, worker->scratchpad)) - return 0; + goto bail_out; if(!reply_info_answer_encode(qinfo, rep, id, flags, repinfo->c->buffer, timenow, 1, worker->scratchpad, udpsize, edns, (int)(edns->bits & EDNS_DO), secure)) { diff --git a/doc/Changelog b/doc/Changelog index c17510516..4cec01bc3 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +6 January 2017: Wouter + - Fix #1201: Fix missing unlock in answer_from_cache error condition. + 5 January 2017: Wouter - Fix to return formerr for queries for meta-types, to avoid packet amplification if this meta-type is sent on to upstream.