From: Ondřej Surý Date: Fri, 23 Sep 2022 14:06:42 +0000 (+0200) Subject: Check the libuv, OpenSSL and libxml2 memory context on exit X-Git-Tag: v9.19.6~27^2~2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=d1cc847ab072df88e7bfc51e5b955fad00011ffc;p=thirdparty%2Fbind9.git Check the libuv, OpenSSL and libxml2 memory context on exit As we can't check the deallocations done in the library memory contexts by default because it would always fail on non-clean exit (that happens on error or by calling exit() early), we just want to enable the checks to be done on normal exit. --- diff --git a/bin/dig/Makefile.am b/bin/dig/Makefile.am index 32dea5bbfdf..b36f0f45251 100644 --- a/bin/dig/Makefile.am +++ b/bin/dig/Makefile.am @@ -6,7 +6,8 @@ AM_CPPFLAGS += \ $(LIBISCCFG_CFLAGS) \ $(LIBIRS_CFLAGS) \ $(LIBBIND9_CFLAGS) \ - $(LIBIDN2_CFLAGS) + $(LIBIDN2_CFLAGS) \ + $(LIBUV_CFLAGS) LDADD += \ libdighost.la \ diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 519c7ef0b13..a8ecf3f55fe 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -54,8 +54,11 @@ #include #include #include +#include #include #include +#include +#include #include #include @@ -4701,6 +4704,12 @@ destroy_libs(void) { } isc_managers_destroy(&mctx, &loopmgr, &netmgr, &taskmgr); + + isc__tls_setdestroycheck(true); + isc__uv_setdestroycheck(true); + isc__xml_setdestroycheck(true); + + isc_mem_checkdestroyed(stderr); } #ifdef HAVE_LIBIDN2 diff --git a/bin/named/main.c b/bin/named/main.c index 3eba68479d3..236c55d942f 100644 --- a/bin/named/main.c +++ b/bin/named/main.c @@ -1584,6 +1584,10 @@ main(int argc, char *argv[]) { &named_g_taskmgr); isc_mem_checkdestroyed(stderr); + isc__tls_setdestroycheck(true); + isc__uv_setdestroycheck(true); + isc__xml_setdestroycheck(true); + named_main_setmemstats(NULL); named_os_closedevnull();