diff --git a/bin/lwresd/main.c b/bin/lwresd/main.c index 054580539e..32c83b3f5c 100644 --- a/bin/lwresd/main.c +++ b/bin/lwresd/main.c @@ -92,14 +92,15 @@ create_view(isc_mem_t *mctx) if (result != ISC_R_SUCCESS) goto out; + rootdb = NULL; result = dns_rootns_create(mctx, &rootdb); if (result != ISC_R_SUCCESS) goto out; dns_view_sethints(view, rootdb); + dns_db_detach(&rootdb); dns_view_freeze(view); - dns_db_detach(&rootdb); return (ISC_R_SUCCESS); @@ -107,8 +108,6 @@ out: if (view != NULL) dns_view_detach(&view); - dns_db_detach(&rootdb); - return (result); }