diff --git a/bin/named/main.c b/bin/named/main.c index 2201ce002d..c66425e18f 100644 --- a/bin/named/main.c +++ b/bin/named/main.c @@ -1524,15 +1524,6 @@ main(int argc, char *argv[]) { pk11_result_register(); #endif /* if USE_PKCS11 */ -#if !ISC_MEM_DEFAULTFILL - /* - * Update the default flags to remove ISC_MEMFLAG_FILL - * before we parse the command line. If disabled here, - * it can be turned back on with -M fill. - */ - isc_mem_defaultflags &= ~ISC_MEMFLAG_FILL; -#endif /* if !ISC_MEM_DEFAULTFILL */ - parse_command_line(argc, argv); #ifdef ENABLE_AFL diff --git a/configure.ac b/configure.ac index c8d75b2bf7..1d1d1c7fa6 100644 --- a/configure.ac +++ b/configure.ac @@ -158,7 +158,7 @@ AC_ARG_ENABLE([developer], AS_IF([test "$enable_developer" = "yes"], [DEVELOPER_MODE=yes - STD_CPPFLAGS="$STD_CPPFLAGS -DISC_MEM_DEFAULTFILL=1 -DISC_LIST_CHECKINIT=1" + STD_CPPFLAGS="$STD_CPPFLAGS -DISC_MEM_DEFAULTFILL=1 -DISC_MEM_TRACKLINES=1 -DISC_LIST_CHECKINIT=1" test "${enable_fixed_rrset+set}" = set || enable_fixed_rrset=yes test "${enable_querytrace+set}" = set || enable_querytrace=yes test "${with_cmocka+set}" = set || with_cmocka=yes diff --git a/lib/isc/include/isc/mem.h b/lib/isc/include/isc/mem.h index 7d63ffef23..1d274316dd 100644 --- a/lib/isc/include/isc/mem.h +++ b/lib/isc/include/isc/mem.h @@ -33,7 +33,7 @@ typedef void (*isc_mem_water_t)(void *, int); * allocation and freeing by file and line number. */ #ifndef ISC_MEM_TRACKLINES -#define ISC_MEM_TRACKLINES 1 +#define ISC_MEM_TRACKLINES 0 #endif /* ifndef ISC_MEM_TRACKLINES */ LIBISC_EXTERNAL_DATA extern unsigned int isc_mem_debugging; @@ -90,10 +90,14 @@ LIBISC_EXTERNAL_DATA extern unsigned int isc_mem_defaultflags; #define ISC_MEMFLAG_FILL \ 0x00000004 /* fill with pattern after alloc and frees */ -#if !ISC_MEM_USE_INTERNAL_MALLOC -#define ISC_MEMFLAG_DEFAULT 0 -#else /* if !ISC_MEM_USE_INTERNAL_MALLOC */ +/*% + * Define ISC_MEM_DEFAULTFILL=1 to turn filling the memory with pattern + * after alloc and free. + */ +#if ISC_MEM_DEFAULTFILL #define ISC_MEMFLAG_DEFAULT ISC_MEMFLAG_FILL +#else /* if !ISC_MEM_USE_INTERNAL_MALLOC */ +#define ISC_MEMFLAG_DEFAULT 0 #endif /* if !ISC_MEM_USE_INTERNAL_MALLOC */ /*%