From 7b6f3bd52dc20f14fe0e73859e4d63e5668bc97c Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Sun, 7 Feb 2016 12:10:14 +0000 Subject: [PATCH] Avoid RE compile unneeded unless LOOKUP_MODULE_DIR defined --- src/src/drtables.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/src/drtables.c b/src/src/drtables.c index ec4e72683..f6629634d 100644 --- a/src/src/drtables.c +++ b/src/src/drtables.c @@ -517,8 +517,6 @@ void 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; @@ -603,6 +601,9 @@ void 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; @@ -659,14 +660,13 @@ void 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); -- 2.30.2