mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-10 22:39:58 -04:00
pass rng to destroy
This commit is contained in:
parent
0c57bf16a5
commit
23fe5cbb07
2 changed files with 5 additions and 5 deletions
|
|
@ -318,6 +318,8 @@ tostruct_hip(ARGS_TOSTRUCT) {
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue