diff options
Diffstat (limited to 'libunbound/libunbound.c')
-rw-r--r-- | libunbound/libunbound.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libunbound/libunbound.c b/libunbound/libunbound.c index 9b4dcab15794..b4cd7fa0bcc2 100644 --- a/libunbound/libunbound.c +++ b/libunbound/libunbound.c @@ -62,6 +62,7 @@ #include "services/localzone.h" #include "services/cache/infra.h" #include "services/cache/rrset.h" +#include "services/authzone.h" #include "sldns/sbuffer.h" #ifdef HAVE_PTHREAD #include <signal.h> @@ -88,6 +89,7 @@ static struct ub_ctx* ub_ctx_create_nopipe(void) WSADATA wsa_data; #endif + checklock_start(); log_init(NULL, 0, NULL); /* logs to stderr */ log_ident_set("libunbound"); #ifdef USE_WINSOCK @@ -141,6 +143,16 @@ static struct ub_ctx* ub_ctx_create_nopipe(void) errno = ENOMEM; return NULL; } + ctx->env->auth_zones = auth_zones_create(); + if(!ctx->env->auth_zones) { + edns_known_options_delete(ctx->env); + config_delete(ctx->env->cfg); + free(ctx->env); + ub_randfree(ctx->seed_rnd); + free(ctx); + errno = ENOMEM; + return NULL; + } ctx->env->alloc = &ctx->superalloc; ctx->env->worker = NULL; ctx->env->need_to_validate = 0; @@ -310,6 +322,7 @@ ub_ctx_delete(struct ub_ctx* ctx) infra_delete(ctx->env->infra_cache); config_delete(ctx->env->cfg); edns_known_options_delete(ctx->env); + auth_zones_delete(ctx->env->auth_zones); free(ctx->env); } ub_randfree(ctx->seed_rnd); |