]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check that handle is non-NULL before dereferencing it
authorMark Andrews <marka@isc.org>
Tue, 7 Jul 2020 08:46:44 +0000 (18:46 +1000)
committerMark Andrews <marka@isc.org>
Mon, 13 Jul 2020 00:16:47 +0000 (10:16 +1000)
lib/dns/dnstap.c

index 219652479c6fd418e10ffa1f5112c3f7b88cbdf1..f107b990c9ec9cee48abc948bf4b2db422d458bc 100644 (file)
@@ -895,7 +895,9 @@ dns_dt_open(const char *filename, dns_dtmode_t mode, isc_mem_t *mctx,
        handle = NULL;
 
  cleanup:
-       if (result != ISC_R_SUCCESS && handle->reader != NULL) {
+       if (result != ISC_R_SUCCESS &&
+           handle != NULL && handle->reader != NULL)
+       {
                fstrm_reader_destroy(&handle->reader);
                handle->reader = NULL;
        }