From: Jeremy Harris Date: Sun, 7 Feb 2016 12:10:14 +0000 (+0000) Subject: Avoid RE compile unneeded unless LOOKUP_MODULE_DIR defined X-Git-Tag: exim-4_88_RC1~142 X-Git-Url: https://git.exim.org/users/heiko/exim.git/commitdiff_plain/f322340bc278be97bc93a4f8be5a8fd9e913304e Avoid RE compile unneeded unless LOOKUP_MODULE_DIR defined --- diff --git a/src/src/drtables.c b/src/src/drtables.c index d07123453..c83012944 100644 --- a/src/src/drtables.c +++ b/src/src/drtables.c @@ -524,8 +524,6 @@ init_lookup_list(void) int moduleerrors = 0; #endif struct lookupmodulestr *p; - const pcre *regex_islookupmod = regex_must_compile( - US"\\." DYNLIB_FN_EXT "$", FALSE, TRUE); if (lookup_list_init_done) return; @@ -610,6 +608,9 @@ init_lookup_list(void) log_write(0, LOG_MAIN, "Couldn't open %s: not loading lookup modules\n", LOOKUP_MODULE_DIR); } else { + const pcre *regex_islookupmod = regex_must_compile( + US"\\." DYNLIB_FN_EXT "$", FALSE, TRUE); + DEBUG(D_lookup) debug_printf("Loading lookup modules from %s\n", LOOKUP_MODULE_DIR); while ((ent = readdir(dd)) != NULL) { char *name = ent->d_name; @@ -666,14 +667,13 @@ init_lookup_list(void) countmodules++; } } + store_free((void*)regex_islookupmod); closedir(dd); } DEBUG(D_lookup) debug_printf("Loaded %d lookup modules\n", countmodules); #endif - store_free((void*)regex_islookupmod); - DEBUG(D_lookup) debug_printf("Total %d lookups\n", lookup_list_count); lookup_list = store_malloc(sizeof(lookup_info *) * lookup_list_count);