Commit 491fe181 authored by Ondřej Surý's avatar Ondřej Surý

Move the validity check from cache_free to the caller functions

parent 9595a4f6
Pipeline #22563 failed with stages
in 11 minutes and 57 seconds
......@@ -317,8 +317,6 @@ cleanup_filelock:
static void
cache_free(dns_cache_t *cache) {
REQUIRE(VALID_CACHE(cache));
isc_refcount_destroy(&cache->references);
isc_refcount_destroy(&cache->live_tasks);
......@@ -486,10 +484,9 @@ static isc_result_t
cache_dump(dns_cache_t *cache) {
isc_result_t result;
REQUIRE(VALID_CACHE(cache));
if (cache->filename == NULL)
if (cache->filename == NULL) {
return (ISC_R_SUCCESS);
}
LOCK(&cache->filelock);
result = dns_master_dump(cache->mctx, cache->db, NULL,
......@@ -985,6 +982,8 @@ static void
cleaner_shutdown_action(isc_task_t *task, isc_event_t *event) {
dns_cache_t *cache = event->ev_arg;
REQUIRE(VALID_CACHE(cache));
UNUSED(task);
INSIST(task == cache->cleaner.task);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment