Commit 23fe5cbb authored by Mark Andrews's avatar Mark Andrews
Browse files

pass rng to destroy

parent 0c57bf16
......@@ -318,6 +318,8 @@ tostruct_hip(ARGS_TOSTRUCT) {
goto cleanup;
isc_region_consume(&region, 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;
......
......@@ -243,15 +243,13 @@ isc_rng_attach(isc_rng_t *source, isc_rng_t **targetp) {
}
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
......@@ -273,7 +271,7 @@ isc_rng_detach(isc_rng_t **rngp) {
UNLOCK(&rng->lock);
if (dest)
destroy(rngp);
destroy(rng);
}
static void
......
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