[exim-cvs] regex: avoid releasing built RE midloop

Inizio della pagina
Delete this message
Reply to this message
Autore: Exim Git Commits Mailing List
Data:  
To: exim-cvs
Oggetto: [exim-cvs] regex: avoid releasing built RE midloop
Gitweb: https://git.exim.org/exim.git/commitdiff/44b3172e369435c2c1baa4e9c837252f729d2905
Commit:     44b3172e369435c2c1baa4e9c837252f729d2905
Parent:     7502f0cbd3753de473a2279acaae15f9bbdfb5ee
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Thu Feb 15 19:56:40 2024 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Thu Feb 15 19:56:40 2024 +0000


    regex: avoid releasing built RE midloop
---
 src/src/regex.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)


diff --git a/src/src/regex.c b/src/src/regex.c
index 642b9cf93..285ab8dbd 100644
--- a/src/src/regex.c
+++ b/src/src/regex.c
@@ -120,7 +120,6 @@ FILE * mbox_file;
pcre_list * re_list_head;
long f_pos = 0;
int ret = FAIL, cnt, lcount = REGEX_LOOPCOUNT_STORE_RESET;
-rmark reset_point;

regex_vars_clear();

@@ -144,11 +143,11 @@ else
mbox_file = mime_stream;
}

-reset_point = store_mark();
-  {
   /* precompile our regexes */
   if ((re_list_head = compile(*listptr, cacheable, &cnt)))
     {
+    rmark reset_point = store_mark();
+
     /* match each line against all regexes */
     while (fgets(CS big_buffer, big_buffer_size, mbox_file))
       {
@@ -167,9 +166,9 @@ reset_point = store_mark();
     lcount = REGEX_LOOPCOUNT_STORE_RESET;
     }
       }
+
+    store_reset(reset_point);
     }
-  }
-store_reset(reset_point);


if (!mime_stream)
(void)fclose(mbox_file);

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-cvs.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-cvs-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/