From 782cd6acc13588180fdb766e3f44f92dd3791383 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Tue, 20 Sep 2016 22:18:56 +1000 Subject: [PATCH] * f2b_filter_load_file() : call flush() before loading filters --- src/filter.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/filter.c b/src/filter.c index b38e5a7..a9391dc 100644 --- a/src/filter.c +++ b/src/filter.c @@ -18,11 +18,15 @@ f2b_filter_load_file(f2b_filter_t *filter, const char *path) { char line[REGEX_LINE_MAX] = ""; char *p, *q; + assert(filter != NULL); + assert(path != NULL); + if ((f = fopen(path, "r")) == NULL) { f2b_log_msg(log_error, "can't open regex list '%s': %s", path, strerror(errno)); return false; } + filter->flush(filter->cfg); while (1) { p = fgets(line, sizeof(line), f); if (!p && (feof(f) || ferror(f)))