mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 15:05:23 +00:00
destroy() did not free TSIG keys; result from dns_tsig_init()
was not checked
This commit is contained in:
@@ -110,6 +110,8 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
|
|||||||
view->statickeys = NULL;
|
view->statickeys = NULL;
|
||||||
view->dynamickeys = NULL;
|
view->dynamickeys = NULL;
|
||||||
result = dns_tsig_init(NULL, view->mctx, &view->dynamickeys);
|
result = dns_tsig_init(NULL, view->mctx, &view->dynamickeys);
|
||||||
|
if (result != DNS_R_SUCCESS)
|
||||||
|
goto cleanup_zt;
|
||||||
ISC_LINK_INIT(view, link);
|
ISC_LINK_INIT(view, link);
|
||||||
ISC_EVENT_INIT(&view->resevent, sizeof view->resevent, 0, NULL,
|
ISC_EVENT_INIT(&view->resevent, sizeof view->resevent, 0, NULL,
|
||||||
DNS_EVENT_VIEWRESSHUTDOWN, resolver_shutdown,
|
DNS_EVENT_VIEWRESSHUTDOWN, resolver_shutdown,
|
||||||
@@ -166,6 +168,10 @@ destroy(dns_view_t *view) {
|
|||||||
REQUIRE(RESSHUTDOWN(view));
|
REQUIRE(RESSHUTDOWN(view));
|
||||||
REQUIRE(ADBSHUTDOWN(view));
|
REQUIRE(ADBSHUTDOWN(view));
|
||||||
|
|
||||||
|
if (view->dynamickeys != NULL)
|
||||||
|
dns_tsig_destroy(&view->dynamickeys);
|
||||||
|
if (view->statickeys != NULL)
|
||||||
|
dns_tsig_destroy(&view->statickeys);
|
||||||
if (view->adb != NULL)
|
if (view->adb != NULL)
|
||||||
dns_adb_detach(&view->adb);
|
dns_adb_detach(&view->adb);
|
||||||
if (view->resolver != NULL)
|
if (view->resolver != NULL)
|
||||||
|
Reference in New Issue
Block a user