]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
set the magic number at the end of dns_dt_create()
authorEvan Hunt <each@isc.org>
Wed, 23 Jan 2019 18:48:25 +0000 (10:48 -0800)
committerEvan Hunt <each@isc.org>
Wed, 23 Jan 2019 19:13:32 +0000 (11:13 -0800)
(cherry picked from commit c29abd307c9db745d292f2ca1204edf6414d6a30)

lib/dns/dnstap.c

index 6ff4e57ce0b420f64d3728f9740f8b65fa3ea5fb..f311c38b69110ef33ee5640bfc4856688d54bb5b 100644 (file)
@@ -218,9 +218,6 @@ dns_dt_create2(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;
@@ -276,6 +273,9 @@ dns_dt_create2(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: