]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Restore dns_validator_destroy and fetchctx_detach call order
authorMark Andrews <marka@isc.org>
Mon, 4 Sep 2023 23:46:05 +0000 (09:46 +1000)
committerMark Andrews <marka@isc.org>
Tue, 5 Sep 2023 23:23:00 +0000 (09:23 +1000)
7a78a85b moved the destruction of the validator from near the start
validated to the end.  This reversed the order of dns_validator_destroy
and fetchctx_detach.  Restore the order so that val->name remains
valid for the lifetime of the validator.

lib/dns/resolver.c

index fb1e401e7804623acb7eea88d070f964209896fd..d017c2b3b03fe6825a60b4127f9c49db792aa0cf 100644 (file)
@@ -5622,9 +5622,14 @@ cleanup_fetchctx:
                fctx_done_unref(fctx, result);
        }
 
+       /*
+        * val->name points to name on a message on one of the
+        * queries on the fetch context so the validator has to
+        * be destroyed first.
+        */
+       dns_validator_destroy(&val);
        fetchctx_detach(&fctx);
        INSIST(node == NULL);
-       dns_validator_destroy(&val);
 }
 
 static void