From: Ondřej Surý Date: Fri, 27 Sep 2019 10:11:16 +0000 (+0200) Subject: lib/ns/interfacemgr.c: Fix invalid order of DbC checks that could cause dereference... X-Git-Tag: v9.15.6~72^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=033f3eb58046f2f1f97d434bc3e7bdc6f2c15125;p=thirdparty%2Fbind9.git lib/ns/interfacemgr.c: Fix invalid order of DbC checks that could cause dereference before NULL check --- diff --git a/lib/ns/interfacemgr.c b/lib/ns/interfacemgr.c index 923c057cee1..a473d50eea9 100644 --- a/lib/ns/interfacemgr.c +++ b/lib/ns/interfacemgr.c @@ -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++)