dns_resolver_t *res = NULL;
dns_valarg_t *valarg = NULL;
dns_validatorevent_t *vevent = NULL;
- fetchctx_t *fctx = NULL, *vfctx = NULL;
+ fetchctx_t *fctx = NULL;
bool chaining;
bool negative;
bool sentresponse;
fctx = valarg->fctx;
valarg->fctx = NULL;
- vfctx = fctx;
FCTXTRACE("received validation completion event");
*/
if (SHUTTINGDOWN(fctx) && !sentresponse) {
UNLOCK(&res->buckets[bucketnum].lock);
+ fctx_detach(&fctx);
goto cleanup_event;
}
}
result = fctx->vresult;
add_bad(fctx, message, addrinfo, result, badns_validation);
+ dns_message_detach(&message);
isc_event_free(&event);
UNLOCK(&res->buckets[bucketnum].lock);
fctx->validator = ISC_LIST_HEAD(fctx->validators);
if (fctx->validator != NULL) {
dns_validator_send(fctx->validator);
+ fctx_detach(&fctx);
} else if (sentresponse) {
+ /* Detach the extra ref that was set in valcreate() */
+ fctx_unref(fctx);
fctx_done_detach(&fctx, result); /* Locks bucket */
} else if (result == DNS_R_BROKENCHAIN) {
isc_result_t tresult;
dns_resolver_addbadcache(res, fctx->name,
fctx->type, &expire);
}
+
+ /* Detach the extra ref that was set in valcreate() */
+ fctx_unref(fctx);
fctx_done_detach(&fctx, result); /* Locks bucket */
} else {
fctx_try(fctx, true, true); /* Locks bucket */
+ fctx_detach(&fctx);
}
-
- dns_message_detach(&message);
- fctx_detach(&vfctx);
return;
}
maybe_cancel_validators(fctx, true);
}
UNLOCK(&res->buckets[bucketnum].lock);
+ fctx_detach(&fctx);
goto cleanup_event;
}
dns_db_detachnode(fctx->cache, &node);
UNLOCK(&res->buckets[bucketnum].lock);
dns_validator_send(ISC_LIST_HEAD(fctx->validators));
+ fctx_detach(&fctx);
goto cleanup_event;
}
}
UNLOCK(&res->buckets[bucketnum].lock);
+ /* Detach the extra reference that was set in valcreate() */
+ fctx_unref(fctx);
fctx_done_detach(&fctx, result); /* Locks bucket. */
cleanup_event:
INSIST(node == NULL);
dns_message_detach(&message);
- fctx_detach(&vfctx);
isc_event_free(&event);
}