set the magic number at the end of dns_dt_create()

This commit is contained in:
Evan Hunt
2019-01-23 10:48:25 -08:00
parent e6bf898edf
commit c29abd307c

View File

@@ -211,8 +211,6 @@ dns_dt_create(isc_mem_t *mctx, dns_dtmode_t mode, const char *path,
env = isc_mem_get(mctx, sizeof(dns_dtenv_t));
memset(env, 0, sizeof(dns_dtenv_t));
env->magic = DTENV_MAGIC;
isc_mem_attach(mctx, &env->mctx);
env->reopen_task = reopen_task;
isc_mutex_init(&env->reopen_lock);
env->reopen_queued = false;
@@ -267,6 +265,9 @@ dns_dt_create(isc_mem_t *mctx, dns_dtmode_t mode, const char *path,
env->fopt = *foptp;
*foptp = NULL;
isc_mem_attach(mctx, &env->mctx);
env->magic = DTENV_MAGIC;
*envp = env;
cleanup: