git://git.exim.org
/
exim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7502f0c
)
regex: avoid releasing built RE midloop
author
Jeremy Harris
<jgh146exb@wizmail.org>
Thu, 15 Feb 2024 19:56:40 +0000
(19:56 +0000)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Thu, 15 Feb 2024 19:56:40 +0000
(19:56 +0000)
src/src/regex.c
patch
|
blob
|
history
diff --git
a/src/src/regex.c
b/src/src/regex.c
index 642b9cf9322f324ba0db9cbccde7537e6a47490b..285ab8dbd2582a3416f91a8cf0a0337a295b7be4 100644
(file)
--- 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;
pcre_list * re_list_head;
long f_pos = 0;
int ret = FAIL, cnt, lcount = REGEX_LOOPCOUNT_STORE_RESET;
-rmark reset_point;
regex_vars_clear();
regex_vars_clear();
@@
-144,11
+143,11
@@
else
mbox_file = mime_stream;
}
mbox_file = mime_stream;
}
-reset_point = store_mark();
- {
/* precompile our regexes */
if ((re_list_head = compile(*listptr, cacheable, &cnt)))
{
/* 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))
{
/* 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;
}
}
lcount = REGEX_LOOPCOUNT_STORE_RESET;
}
}
+
+ store_reset(reset_point);
}
}
- }
-store_reset(reset_point);
if (!mime_stream)
(void)fclose(mbox_file);
if (!mime_stream)
(void)fclose(mbox_file);