2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

pass rng to destroy

This commit is contained in:
Mark Andrews
2014-06-11 22:57:46 +10:00
parent 0c57bf16a5
commit 23fe5cbb07
2 changed files with 5 additions and 5 deletions

View File

@@ -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;

View File

@@ -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