]> git.ipfire.org Git - thirdparty/bind9.git/commit
dnssec-checkds: cleanup memory on error paths
authorMark Andrews <marka@isc.org>
Tue, 31 Jan 2023 02:50:36 +0000 (13:50 +1100)
committerMark Andrews <marka@isc.org>
Wed, 8 Feb 2023 21:35:27 +0000 (08:35 +1100)
commit13f9d2995497edf8c6c664ea46bd46fd1da17fe8
treea1975ffd0248801c5617d21a735179d6d11270bb
parent81bde388e4303c463549c53773e8a0dfb00c3e53
dnssec-checkds: cleanup memory on error paths

Move and give unique names to the dns_db_t, dns_dbnode_t and
dns_dbversion_t pointers, so they have global scope and therefore
are visible to cleanup.  Unique names are not strictly necessary,
as none of the functions involved call each other.

Change free_db to handle NULL pointers and also an optional
(dns_dbversion_t **).

In match_keyset_dsset and free_keytable, ki to be handled
differently to prevent a false positive NULL pointer dereference
warning from scan.

In formatset moved dns_master_styledestroy earlier and freed
buf before calling check_result to prevent memory leak.

In append_new_ds_set freed ds on the default path before
calling check_result to prevent memory leak.
bin/dnssec/dnssec-cds.c