From d776a73362158d7414a6864b882461aae8f9d477 Mon Sep 17 00:00:00 2001
From: Mark Andrews <marka@isc.org>
Date: Mon, 24 Aug 2020 13:34:54 +1000
Subject: [PATCH] Take complete ownership of *validatorp before calling
 destroy.

Conflict: NA
Reference: https://gitlab.isc.org/isc-projects/bind9/-/commit/d776a73362158d7414a6864b882461aae8f9d477
---
 lib/dns/validator.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/dns/validator.c b/lib/dns/validator.c
index ef5fd255e7..c8ee09172a 100644
--- a/lib/dns/validator.c
+++ b/lib/dns/validator.c
@@ -3907,6 +3907,7 @@ dns_validator_destroy(dns_validator_t **validatorp) {
 
 	REQUIRE(validatorp != NULL);
 	val = *validatorp;
+	*validatorp = NULL;
 	REQUIRE(VALID_VALIDATOR(val));
 
 	LOCK(&val->lock);
@@ -3920,8 +3921,6 @@ dns_validator_destroy(dns_validator_t **validatorp) {
 
 	if (want_destroy)
 		destroy(val);
-
-	*validatorp = NULL;
 }
 
 static void
-- 
2.23.0

