check for NULL before closing batchfp

this silences a warning from clang-scan 19.
This commit is contained in:
Evan Hunt
2024-08-21 12:08:08 -07:00
parent 9f9a63b04e
commit 2b58dc89f5

View 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);