]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Cleanup dead code in dnstap-read
authorMark Andrews <marka@isc.org>
Wed, 1 Nov 2023 17:09:25 +0000 (04:09 +1100)
committerMark Andrews <marka@isc.org>
Wed, 1 Nov 2023 20:58:22 +0000 (20:58 +0000)
Remove 'b' from main as it is unused.

bin/tools/dnstap-read.c

index bc5f69d370448315edcadfba16f45f2f92b4b601..b998d9db7ff48d1230cccd0491bc190887513463 100644 (file)
@@ -336,7 +336,6 @@ int
 main(int argc, char *argv[]) {
        isc_result_t result;
        dns_message_t *message = NULL;
-       isc_buffer_t *b = NULL;
        dns_dtdata_t *dt = NULL;
        dns_dthandle_t *handle = NULL;
        int rv = 0, ch;
@@ -392,17 +391,8 @@ main(int argc, char *argv[]) {
                input.base = data;
                input.length = datalen;
 
-               if (b != NULL) {
-                       isc_buffer_free(&b);
-               }
-               isc_buffer_allocate(mctx, &b, 2048);
-               if (b == NULL) {
-                       fatal("out of memory");
-               }
-
                result = dns_dt_parse(mctx, &input, &dt);
                if (result != ISC_R_SUCCESS) {
-                       isc_buffer_free(&b);
                        continue;
                }
 
@@ -431,9 +421,6 @@ cleanup:
        if (message != NULL) {
                dns_message_detach(&message);
        }
-       if (b != NULL) {
-               isc_buffer_free(&b);
-       }
        isc_mem_destroy(&mctx);
 
        exit(rv);