]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Silence CID 320481: Null pointer dereferences
authorMark Andrews <marka@isc.org>
Sun, 21 Feb 2021 22:28:37 +0000 (09:28 +1100)
committerMark Andrews <marka@isc.org>
Tue, 23 Feb 2021 12:45:45 +0000 (12:45 +0000)
    *** CID 320481:  Null pointer dereferences  (REVERSE_INULL)
    /bin/tests/wire_test.c: 261 in main()
    255      process_message(input);
    256      }
    257      } else {
    258      process_message(input);
    259      }
    260
       CID 320481:  Null pointer dereferences  (REVERSE_INULL)
       Null-checking "input" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    261      if (input != NULL) {
    262      isc_buffer_free(&input);
    263      }
    264
    265      if (printmemstats) {
    266      isc_mem_stats(mctx, stdout);

bin/tests/wire_test.c

index 107f2cc7a1b0badf176b8fa6d9906db8a2a956b5..ef86a1e7c561a1f5b0d535da4094035330daef07 100644 (file)
@@ -258,9 +258,7 @@ main(int argc, char *argv[]) {
                process_message(input);
        }
 
-       if (input != NULL) {
-               isc_buffer_free(&input);
-       }
+       isc_buffer_free(&input);
 
        if (printmemstats) {
                isc_mem_stats(mctx, stdout);