vmod_regex_match_dyn appears to leak memory
The vre allocation doesn't appear to get freed in vmod_regex_match_dyn.
Patch we are currently testing against 81ad14f5:
diff --git a/src/vmod_re.c b/src/vmod_re.c
index 4f7e3ef..653b723 100644
--- a/src/vmod_re.c
+++ b/src/vmod_re.c
@@ -232,6 +232,7 @@ vmod_regex_match_dyn(const struct vrt_ctx *ctx, struct vmod_re_regex *re,
vre_t *vre;
int erroffset;
const char *error;
+ int dyn_return;
AN(pattern);
vre = VRE_compile(pattern, 0, &error, &erroffset);
@@ -241,7 +242,9 @@ vmod_regex_match_dyn(const struct vrt_ctx *ctx, struct vmod_re_regex *re,
pattern, error, erroffset);
return 0;
}
- return match(ctx, re, vre, subject);
+ dyn_return = match(ctx, re, vre, subject);
+ VRE_free(&vre);
+ return dyn_return;
}
VCL_STRING