]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
lib/ns/interfacemgr.c: Fix invalid order of DbC checks that could cause dereference...
authorOndřej Surý <ondrej@sury.org>
Fri, 27 Sep 2019 10:11:16 +0000 (12:11 +0200)
committerOndřej Surý <ondrej@sury.org>
Thu, 3 Oct 2019 07:04:27 +0000 (09:04 +0200)
lib/ns/interfacemgr.c

index 923c057cee1ea40db2e377336ef5c965a857e883..a473d50eea9f56a4d197e51776b3dd4743ff507e 100644 (file)
@@ -623,11 +623,13 @@ ns_interface_shutdown(ns_interface_t *ifp) {
 
 static void
 ns_interface_destroy(ns_interface_t *ifp) {
-       isc_mem_t *mctx = ifp->mgr->mctx;
+       isc_mem_t *mctx;
        int disp;
 
        REQUIRE(NS_INTERFACE_VALID(ifp));
 
+       mctx = ifp->mgr->mctx;
+
        ns_interface_shutdown(ifp);
 
        for (disp = 0; disp < ifp->nudpdispatch; disp++)