diff --git a/lib/dns/zone.c b/lib/dns/zone.c index b524a90189..693e048f89 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -12523,6 +12523,9 @@ zone_notify(dns_zone_t *zone, isc_time_t *now) { "could not get TLS configuration " "for zone transfer: %s", isc_result_totext(result)); + if (key != NULL) { + dns_tsigkey_detach(&key); + } goto next; } @@ -12536,6 +12539,12 @@ zone_notify(dns_zone_t *zone, isc_time_t *now) { INSIST(isc_sockaddr_pf(&src) == isc_sockaddr_pf(&dst)); if (isc_sockaddr_disabled(&dst)) { + if (key != NULL) { + dns_tsigkey_detach(&key); + } + if (transport != NULL) { + dns_transport_detach(&transport); + } goto next; }