diff --git a/bin/named/main.c b/bin/named/main.c index df9ec70f3d..10e4f536a0 100644 --- a/bin/named/main.c +++ b/bin/named/main.c @@ -1443,6 +1443,10 @@ main(int argc, char *argv[]) { setvbuf(stderr, NULL, _IOFBF, BUFSIZ); #endif +#ifdef HAVE_LIBXML2 + xmlInitThreads(); +#endif /* HAVE_LIBXML2 */ + /* * Record version in core image. * strings named.core | grep "named version:" @@ -1575,6 +1579,10 @@ main(int argc, char *argv[]) { named_os_shutdown(); +#ifdef HAVE_LIBXML2 + xmlCleanupThreads(); +#endif /* HAVE_LIBXML2 */ + #ifdef HAVE_GPERFTOOLS_PROFILER ProfilerStop(); #endif diff --git a/bin/named/statschannel.c b/bin/named/statschannel.c index c125b659cf..841741a943 100644 --- a/bin/named/statschannel.c +++ b/bin/named/statschannel.c @@ -3593,10 +3593,6 @@ named_statschannels_configure(named_server_t *server, const cfg_obj_t *config, ISC_LIST_INIT(new_listeners); -#ifdef HAVE_LIBXML2 - xmlInitThreads(); -#endif /* HAVE_LIBXML2 */ - /* * Get the list of named.conf 'statistics-channels' statements. */ @@ -3729,10 +3725,6 @@ named_statschannels_shutdown(named_server_t *server) { ISC_LIST_UNLINK(server->statschannels, listener, link); shutdown_listener(listener); } - -#ifdef HAVE_LIBXML2 - xmlCleanupThreads(); -#endif /* HAVE_LIBXML2 */ } isc_result_t