mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 15:45:25 +00:00
pass rng to destroy
This commit is contained in:
@@ -318,6 +318,8 @@ tostruct_hip(ARGS_TOSTRUCT) {
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
isc_region_consume(®ion, hip->hit_len);
|
isc_region_consume(®ion, hip->hit_len);
|
||||||
|
|
||||||
|
INSIST(hip->key_len <= region.length);
|
||||||
|
|
||||||
hip->key = mem_maybedup(mctx, region.base, hip->key_len);
|
hip->key = mem_maybedup(mctx, region.base, hip->key_len);
|
||||||
if (hip->key == NULL)
|
if (hip->key == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@@ -243,15 +243,13 @@ isc_rng_attach(isc_rng_t *source, isc_rng_t **targetp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
destroy(isc_rng_t **rngp) {
|
destroy(isc_rng_t *rng) {
|
||||||
isc_rng_t *rng = *rngp;
|
|
||||||
|
|
||||||
REQUIRE(VALID_RNG(rng));
|
REQUIRE(VALID_RNG(rng));
|
||||||
|
|
||||||
isc_mutex_destroy(&rng->lock);
|
|
||||||
rng->magic = 0;
|
rng->magic = 0;
|
||||||
|
isc_mutex_destroy(&rng->lock);
|
||||||
isc_mem_putanddetach(&rng->mctx, rng, sizeof(isc_rng_t));
|
isc_mem_putanddetach(&rng->mctx, rng, sizeof(isc_rng_t));
|
||||||
*rngp = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -273,7 +271,7 @@ isc_rng_detach(isc_rng_t **rngp) {
|
|||||||
UNLOCK(&rng->lock);
|
UNLOCK(&rng->lock);
|
||||||
|
|
||||||
if (dest)
|
if (dest)
|
||||||
destroy(rngp);
|
destroy(rng);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Reference in New Issue
Block a user