From 8b80f409934078507f7f566ea4c1f281c0354a27 Mon Sep 17 00:00:00 2001
From: Mark Andrews <marka@isc.org>
Date: Sat, 22 Aug 2020 14:39:17 +1000
Subject: [PATCH] Take complete ownership of *aclp before calling destroy.

Conflict: NA
Reference: https://gitlab.isc.org/isc-projects/bind9/-/commit/8b80f409934078507f7f566ea4c1f281c0354a27
---
 lib/dns/acl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/dns/acl.c b/lib/dns/acl.c
index 3fc8ab78a0..3d7c85d92f 100644
--- a/lib/dns/acl.c
+++ b/lib/dns/acl.c
@@ -565,10 +565,11 @@ dns_acl_detach(dns_acl_t **aclp) {
 
 	REQUIRE(DNS_ACL_VALID(acl));
 
+	*aclp = NULL;
+
 	isc_refcount_decrement(&acl->refcount, &refs);
 	if (refs == 0)
 		destroy(acl);
-	*aclp = NULL;
 }
 
 
-- 
2.23.0

