]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib/resolve: eliminate double initialization
authorVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 15 Nov 2018 14:27:38 +0000 (15:27 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 21 Nov 2018 14:33:41 +0000 (15:33 +0100)
It's just a few lines apart.  It's been generating lots of noise
in CI lint:clang-scan-build.

lib/resolve.c

index 4ef01b5d2f3b30b87c1f9bc217000d5477a57b72..d4f0266f183c59351d2bc1e061449c2ffbd0e412 100644 (file)
@@ -1031,7 +1031,6 @@ static int forward_trust_chain_check(struct kr_request *request, struct kr_query
                return KR_STATE_PRODUCE;
        }
 
-       const knot_dname_t *wanted_name = qry->sname;
        const knot_dname_t *start_name = qry->sname;
        if ((qry->flags.AWAIT_CUT) && !resume) {
                qry->flags.AWAIT_CUT = false;
@@ -1059,12 +1058,9 @@ static int forward_trust_chain_check(struct kr_request *request, struct kr_query
                return KR_STATE_DONE;
        }
 
-       bool nods = false;
-       bool ds_req = false;
-       bool ns_req = false;
-       bool ns_exist = true;
-       bool minimized = false;
        int name_offset = 1;
+       const knot_dname_t *wanted_name;
+       bool nods, ds_req, ns_req, minimized, ns_exist;
        do {
                wanted_name = start_name;
                nods = false;