2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

Silence REVERSE_INULL

Remove unnecessary != NULL checks

    *** CID 352809:  Null pointer dereferences  (REVERSE_INULL) /lib/dns/message.c: 4654 in dns_message_buildopt()
    4648     	if (rdata != NULL) {
    4649     		dns_message_puttemprdata(message, &rdata);
    4650     	}
    4651     	if (rdataset != NULL) {
    4652     		dns_message_puttemprdataset(message, &rdataset);
    4653     	}
    >>>     CID 352809:  Null pointer dereferences  (REVERSE_INULL)
    >>>     Null-checking "rdatalist" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    4654     	if (rdatalist != NULL) {
    4655     		dns_message_puttemprdatalist(message, &rdatalist);
    4656     	}
    4657     	return (result);
    4658     }
    4659
This commit is contained in:
Mark Andrews 2022-07-18 17:21:25 +10:00
parent 24710beaff
commit 8e5a7e8bac

View File

@ -4617,15 +4617,9 @@ dns_message_buildopt(dns_message_t *message, dns_rdataset_t **rdatasetp,
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
cleanup: cleanup:
if (rdata != NULL) { dns_message_puttemprdata(message, &rdata);
dns_message_puttemprdata(message, &rdata); dns_message_puttemprdataset(message, &rdataset);
} dns_message_puttemprdatalist(message, &rdatalist);
if (rdataset != NULL) {
dns_message_puttemprdataset(message, &rdataset);
}
if (rdatalist != NULL) {
dns_message_puttemprdatalist(message, &rdatalist);
}
return (result); return (result);
} }