]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
skip if first is NULL
authorMark Andrews <marka@isc.org>
Thu, 30 Jan 2020 07:55:36 +0000 (18:55 +1100)
committerMark Andrews <marka@isc.org>
Thu, 30 Jan 2020 07:55:36 +0000 (18:55 +1100)
lib/dns/zoneverify.c

index c19367b0a0ec67225df4a53e17f408f9b21cb17f..7a240ff74a61bc18b553c31414113bcdbd508db4 100644 (file)
@@ -1215,15 +1215,15 @@ verify_nsec3_chains(const vctx_t *vctx, isc_mem_t *mctx) {
                        result = ISC_R_FAILURE;
                }
                if (first == NULL || newchain(first, e)) {
-                       if (prev != NULL) {
-                               if (!checknext(vctx, prev, first)) {
-                                       result = ISC_R_FAILURE;
-                               }
-                               if (prev != first) {
-                                       free_element(mctx, prev);
-                               }
-                       }
                        if (first != NULL) {
+                               if (prev != NULL) {
+                                       if (!checknext(vctx, prev, first)) {
+                                               result = ISC_R_FAILURE;
+                                       }
+                                       if (prev != first) {
+                                               free_element(mctx, prev);
+                                       }
+                               }
                                free_element(mctx, first);
                        }
                        prev = first = e;