bryancall commented on code in PR #12594:
URL: https://github.com/apache/trafficserver/pull/12594#discussion_r2461219404
##########
plugins/experimental/maxmind_acl/mmdb.h:
##########
@@ -71,6 +66,20 @@ class Acl
if (db_loaded) {
MMDB_close(&_mmdb);
}
+ for (auto &i : allow_regex) {
+ for (auto &y : i.second) {
+ if (y._rex != nullptr) {
+ delete y._rex;
+ }
+ }
+ }
+ for (auto &i : deny_regex) {
+ for (auto &y : i.second) {
+ if (y._rex != nullptr) {
+ delete y._rex;
+ }
+ }
+ }
Review Comment:
Seems odd to copy a compiled regex instead of sharing one. My initial
thought is we should be sharing the compiled regex instead.
If we want to implement a copy constructor I would use pcre2_code_copy()
that can copy the pcre2 compiled, since we don't have the pattern and I
wouldn't want to deal with reference counting and shallow copies. If we want
this as a feature open an issue and assign it to me. It wouldn't be hard to
add it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]