From: Mark Andrews Date: Sun, 21 Feb 2021 22:28:37 +0000 (+1100) Subject: Silence CID 320481: Null pointer dereferences X-Git-Tag: v9.17.11~32^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=658c950d7b96e9af2d6edce68d8944fd257af114;p=thirdparty%2Fbind9.git Silence CID 320481: Null pointer dereferences *** 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); --- diff --git a/bin/tests/wire_test.c b/bin/tests/wire_test.c index 107f2cc7a1b..ef86a1e7c56 100644 --- a/bin/tests/wire_test.c +++ b/bin/tests/wire_test.c @@ -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);