Check view->adb in dns_view_flushcache()

The call to dns_view_flushcache() is done under exclusive mode, but we
still need to check if view->adb is still attached before calling
dns_adb_flush() because the shutdown might have been already
initialized.  This most likely only a theoretical problem on shutdown
because there's either no way how to initiate cache flush when shutting
down or very slim window where the `rndc flush` would have to hit the
slim time during named shutdown.
This commit is contained in:
Ondřej Surý 2022-11-10 09:30:52 +01:00 committed by Ondřej Surý
parent a8ba240325
commit 417097450a

View file

@ -1528,7 +1528,10 @@ dns_view_flushcache(dns_view_t *view, bool fixuponly) {
dns_badcache_flush(view->failcache);
}
dns_adb_flush(view->adb);
if (view->adb) {
dns_adb_flush(view->adb);
}
return (ISC_R_SUCCESS);
}