diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index ded2e296fb..b557b5ac60 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -1562,15 +1562,12 @@ fctx_sendevents(fetchctx_t *fctx, isc_result_t result) { unsigned int new_spillat = 0; /* initialized to silence * compiler warnings */ - /* - * Caller must be holding the fctx lock. - */ + LOCK(&fctx->lock); + REQUIRE(fctx->state == fetchstate_done); FCTXTRACE("sendevents"); - LOCK(&fctx->lock); - /* * Keep some record of fetch result for logging later (if required). */