]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Defer read of zl->server and zl->reconfig until
authorMark Andrews <marka@isc.org>
Fri, 21 Aug 2020 09:51:59 +0000 (19:51 +1000)
committerMark Andrews <marka@isc.org>
Wed, 9 Sep 2020 06:22:38 +0000 (16:22 +1000)
the reference counter has gone to zero and there is
no longer a possibility of changes in other threads.

(cherry picked from commit 9b445f33e27c704941e9fbc3a6af5f44922785bd)

bin/named/server.c

index 75077a090d1c667d2dc316dbccc31a4b2a377286..7a9e4c3e010746a49f12ac535106977d87ed99c9 100644 (file)
@@ -9585,8 +9585,6 @@ static isc_result_t
 view_loaded(void *arg) {
        isc_result_t result;
        ns_zoneload_t *zl = (ns_zoneload_t *)arg;
-       named_server_t *server = zl->server;
-       bool reconfig = zl->reconfig;
 
        /*
         * Force zone maintenance.  Do this after loading
@@ -9597,6 +9595,9 @@ view_loaded(void *arg) {
         * know when all views are finished.
         */
        if (isc_refcount_decrement(&zl->refs) == 1) {
+               named_server_t *server = zl->server;
+               bool reconfig = zl->reconfig;
+
                isc_refcount_destroy(&zl->refs);
                isc_mem_put(server->mctx, zl, sizeof(*zl));