From: Mark Andrews Date: Mon, 18 Jul 2022 06:42:00 +0000 (+1000) Subject: Remove dead code in xfrin.c X-Git-Tag: v9.19.5~13^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24710beaff3dee5d5549afecb34be11d740c3e33;p=thirdparty%2Fbind9.git Remove dead code in xfrin.c 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, ®ion, 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) { --- diff --git a/lib/dns/xfrin.c b/lib/dns/xfrin.c index ab6c2be3edf..a360263265d 100644 --- a/lib/dns/xfrin.c +++ b/lib/dns/xfrin.c @@ -1391,15 +1391,7 @@ xfrin_send_request(dns_xfrin_ctx_t *xfr) { isc_nm_send(xfr->handle, ®ion, 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); }