From c29abd307c9db745d292f2ca1204edf6414d6a30 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Wed, 23 Jan 2019 10:48:25 -0800 Subject: [PATCH] set the magic number at the end of dns_dt_create() --- lib/dns/dnstap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/dns/dnstap.c b/lib/dns/dnstap.c index 2b535b8e06..bf312ed6fe 100644 --- a/lib/dns/dnstap.c +++ b/lib/dns/dnstap.c @@ -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: