From 2b58dc89f5da5a84055fe07edaf8964f8829d1b3 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Wed, 21 Aug 2024 12:08:08 -0700 Subject: [PATCH] check for NULL before closing batchfp this silences a warning from clang-scan 19. --- bin/dig/dig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/dig/dig.c b/bin/dig/dig.c index d4867cc282..3e59f7f21a 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -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);