From: Aram Sargsyan Date: Fri, 25 Mar 2022 11:49:12 +0000 (+0000) Subject: Do not use REQUIRE in dns_catz_entry_detach() after other code X-Git-Tag: v9.19.1~73^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=99d1ec6c4b5c7e002c4a06cbad300c9e605885fb;p=thirdparty%2Fbind9.git Do not use REQUIRE in dns_catz_entry_detach() after other code The REQUIRE checks should be at the top of the function before any assignments or code. Move the REQUIRE check to the top. --- diff --git a/lib/dns/catz.c b/lib/dns/catz.c index 46dd479816c..f3dbbc39896 100644 --- a/lib/dns/catz.c +++ b/lib/dns/catz.c @@ -315,10 +315,9 @@ dns_catz_entry_detach(dns_catz_zone_t *zone, dns_catz_entry_t **entryp) { dns_catz_entry_t *entry; REQUIRE(DNS_CATZ_ZONE_VALID(zone)); - REQUIRE(entryp != NULL); + REQUIRE(entryp != NULL && DNS_CATZ_ENTRY_VALID(*entryp)); entry = *entryp; *entryp = NULL; - REQUIRE(DNS_CATZ_ENTRY_VALID(entry)); if (isc_refcount_decrement(&entry->refs) == 1) { isc_mem_t *mctx = zone->catzs->mctx;