Commit 20af29cd authored by Geoff Simmons's avatar Geoff Simmons

Fix a leak in match_dyn, spotted by Greg Bock.

Closes #2
parent 92b3349c
Pipeline #207 skipped
......@@ -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;
VCL_BOOL 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment