fetchctx_t *fctx;
isc_result_t result;
bool bucket_empty;
- bool locked = false;
unsigned int bucketnum;
unsigned int findoptions = 0;
dns_name_t *fname, *dcname;
dns_resolver_destroyfetch(&fctx->qminfetch);
+ if (SHUTTINGDOWN(fctx)) {
+ maybe_destroy(fctx, false);
+ goto cleanup;
+ }
+
/*
* Note: fevent->rdataset must be disassociated and
* isc_event_free(&event) be called before resuming
cleanup:
INSIST(event == NULL);
INSIST(fevent == NULL);
- if (!locked)
- LOCK(&res->buckets[bucketnum].lock);
+ LOCK(&res->buckets[bucketnum].lock);
bucket_empty = fctx_decreference(fctx);
UNLOCK(&res->buckets[bucketnum].lock);
if (bucket_empty)