From 9e565c950b7eef312b2f56125fde371bf1e3f4b7 Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Tue, 8 Feb 2000 18:08:58 +0000 Subject: [PATCH] clean up security roots if TSIG key ring creation fails --- lib/dns/view.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/dns/view.c b/lib/dns/view.c index 8b33607af6..3e7b0096f6 100644 --- a/lib/dns/view.c +++ b/lib/dns/view.c @@ -119,7 +119,7 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, view->dynamickeys = NULL; result = dns_tsigkeyring_create(view->mctx, &view->dynamickeys); if (result != DNS_R_SUCCESS) - goto cleanup_zt; + goto cleanup_secroots; ISC_LINK_INIT(view, link); ISC_EVENT_INIT(&view->resevent, sizeof view->resevent, 0, NULL, DNS_EVENT_VIEWRESSHUTDOWN, resolver_shutdown, @@ -133,6 +133,9 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, return (ISC_R_SUCCESS); + cleanup_secroots: + dns_rbt_destroy(&view->secroots); + cleanup_zt: dns_zt_detach(&view->zonetable);