mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Fix a memory leak issue in catz_process_primaries()
Free the old version of the keyname (if it exists) before setting
the new one.
(cherry picked from commit 4576a67a93)
This commit is contained in:
parent
7eed9397e2
commit
83cd5b52b5
1 changed files with 8 additions and 0 deletions
|
|
@ -1490,6 +1490,14 @@ catz_process_primaries(dns_catz_zone_t *catz, dns_ipkeylist_t *ipkl,
|
|||
|
||||
if (i < ipkl->count) { /* we have this record already */
|
||||
if (value->type == dns_rdatatype_txt) {
|
||||
if (ipkl->keys[i] != NULL) {
|
||||
if (dns_name_dynamic(ipkl->keys[i])) {
|
||||
dns_name_free(ipkl->keys[i],
|
||||
mctx);
|
||||
}
|
||||
isc_mem_put(mctx, ipkl->keys[i],
|
||||
sizeof(*ipkl->keys[i]));
|
||||
}
|
||||
ipkl->keys[i] = keyname;
|
||||
} else { /* A/AAAA */
|
||||
memmove(&ipkl->addrs[i], &sockaddr,
|
||||
|
|
|
|||
Loading…
Reference in a new issue