goto cleanup;
isc_region_consume(®ion, hip->hit_len);
+ INSIST(hip->key_len <= region.length);
+
hip->key = mem_maybedup(mctx, region.base, hip->key_len);
if (hip->key == NULL)
goto cleanup;
}
static void
-destroy(isc_rng_t **rngp) {
- isc_rng_t *rng = *rngp;
+destroy(isc_rng_t *rng) {
REQUIRE(VALID_RNG(rng));
- isc_mutex_destroy(&rng->lock);
rng->magic = 0;
+ isc_mutex_destroy(&rng->lock);
isc_mem_putanddetach(&rng->mctx, rng, sizeof(isc_rng_t));
- *rngp = NULL;
}
void
UNLOCK(&rng->lock);
if (dest)
- destroy(rngp);
+ destroy(rng);
}
static void