From c642f9970a4d3020470626385d190bbf9ae1a5bb Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Fri, 5 Oct 2018 11:13:54 -0700 Subject: [PATCH] move declaration to the top of the block --- lib/dns/rpz.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/dns/rpz.c b/lib/dns/rpz.c index 94f8808e6c..1f919e1201 100644 --- a/lib/dns/rpz.c +++ b/lib/dns/rpz.c @@ -2048,8 +2048,11 @@ cidr_free(dns_rpz_zones_t *rpzs) { */ static void rpz_detach(dns_rpz_zone_t **rpzp, dns_rpz_zones_t *rpzs) { + dns_rpz_zone_t *rpz; + REQUIRE(rpzp != NULL && *rpzp != NULL); - dns_rpz_zone_t *rpz = *rpzp; + + rpz = *rpzp; *rpzp = NULL; if (isc_refcount_decrement(&rpz->refs) != 1) { @@ -2092,7 +2095,7 @@ rpz_detach(dns_rpz_zone_t **rpzp, dns_rpz_zones_t *rpzs) { if (rpz->dbversion != NULL) { dns_db_closeversion(rpz->db, &rpz->dbversion, false); } - if (rpz->db) { + if (rpz->db != NULL) { dns_db_detach(&rpz->db); } if (rpz->updaterunning) {