mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-22 01:56:00 -04:00
check memory context validity before mem_destory
Add a magic number check to ensure the memory context validity before destorying it. This check is needed now as it was done before implicitly when isc_mem_inuse was called, but isc_mem_inuse is now called later (to be able to dump the outstanding allocations).
This commit is contained in:
parent
9f4ff7dec4
commit
c50ace654d
1 changed files with 2 additions and 0 deletions
|
|
@ -547,6 +547,8 @@ mem_create(const char *name, isc_mem_t **ctxp, unsigned int debugging,
|
|||
|
||||
static void
|
||||
mem_destroy(isc_mem_t *ctx) {
|
||||
REQUIRE(VALID_CONTEXT(ctx));
|
||||
|
||||
isc_refcount_destroy(&ctx->references);
|
||||
|
||||
LOCK(&contextslock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue