]> 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:50:27 +0000 (09:50 +0200)
(cherry picked from commit 033f3eb58046f2f1f97d434bc3e7bdc6f2c15125)

lib/ns/interfacemgr.c

index c17010c789aaafc7011f324ebab57c2fc57119df..37e58ae25c61e3d1b0707770348e0a6823045295 100644 (file)
@@ -638,11 +638,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++)