]> 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:12:09 +0000 (14:12 -0500)
lib/dns/dnstap.c

index 2b535b8e06885b5c702c4145ed7436719d7103c9..bf312ed6febf9f9acc37743e7441a09869635ce4 100644 (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: