]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove dead code in xfrin.c
authorMark Andrews <marka@isc.org>
Mon, 18 Jul 2022 06:42:00 +0000 (16:42 +1000)
committerMark Andrews <marka@isc.org>
Tue, 6 Sep 2022 12:47:08 +0000 (12:47 +0000)
also removed unnecessary 'msg != NULL' check

   *** CID 352815:  Control flow issues  (DEADCODE) /lib/dns/xfrin.c: 1363 in xfrin_send_request()
   1357      isc_nmhandle_attach(send_xfr->handle, &xfr->sendhandle);
   1358      isc_refcount_increment0(&send_xfr->sends);
   1359      isc_nm_send(xfr->handle, &region, xfrin_send_done, send_xfr);
   1360
   1361     failure:
   1362      if (qname != NULL) {
   >>>     CID 352815:  Control flow issues  (DEADCODE)
   >>>     Execution cannot reach this statement: "dns_message_puttempname(msg...".
   1363      dns_message_puttempname(msg, &qname);
   1364      }
   1365      if (qrdataset != NULL) {
   1366      dns_message_puttemprdataset(msg, &qrdataset);
   1367      }
   1368      if (msg != NULL) {

   *** CID 352819:  Control flow issues  (DEADCODE) /lib/dns/xfrin.c: 1366 in xfrin_send_request()
   1360
   1361     failure:
   1362      if (qname != NULL) {
   1363      dns_message_puttempname(msg, &qname);
   1364      }
   1365      if (qrdataset != NULL) {
   >>>     CID 352819:  Control flow issues  (DEADCODE)
   >>>     Execution cannot reach this statement: "dns_message_puttemprdataset...".
   1366      dns_message_puttemprdataset(msg, &qrdataset);
   1367      }
   1368      if (msg != NULL) {
   1369      dns_message_detach(&msg);
   1370      }
   1371      if (soatuple != NULL) {

lib/dns/xfrin.c

index ab6c2be3edfaf362f254ac5574af6d3ca8a89d65..a360263265d605a70116b9828a5ac76aae6db2dd 100644 (file)
@@ -1391,15 +1391,7 @@ xfrin_send_request(dns_xfrin_ctx_t *xfr) {
        isc_nm_send(xfr->handle, &region, xfrin_send_done, send_xfr);
 
 failure:
-       if (qname != NULL) {
-               dns_message_puttempname(msg, &qname);
-       }
-       if (qrdataset != NULL) {
-               dns_message_puttemprdataset(msg, &qrdataset);
-       }
-       if (msg != NULL) {
-               dns_message_detach(&msg);
-       }
+       dns_message_detach(&msg);
        if (soatuple != NULL) {
                dns_difftuple_free(&soatuple);
        }