]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
check for NULL before closing batchfp
authorEvan Hunt <each@isc.org>
Wed, 21 Aug 2024 19:08:08 +0000 (12:08 -0700)
committerEvan Hunt <each@isc.org>
Thu, 22 Aug 2024 04:37:51 +0000 (21:37 -0700)
this silences a warning from clang-scan 19.

bin/dig/dig.c

index d4867cc28278459f75bf52ac1a008cb3d9efa0b9..3e59f7f21aa2a11ba9b817e6a6dc153dc354a6c9 100644 (file)
@@ -3079,7 +3079,7 @@ void
 dig_shutdown(void) {
        destroy_lookup(default_lookup);
        if (atomic_load(&batchname) != 0) {
-               if (batchfp != stdin) {
+               if (batchfp != NULL && batchfp != stdin) {
                        fclose(batchfp);
                }
                atomic_store(&batchname, 0);