Commit 82f84eaa authored by Geoff Simmons's avatar Geoff Simmons

Plug a leak in error exits from the match() function.

parent cd4c072f
......@@ -711,6 +711,7 @@ vmod_match(VRT_CTX, struct vmod_priv *priv, VCL_STRING pattern,
if ((err = vre2_ngroups(vre2, &ngroups)) != NULL) {
VERR(ctx, "Cannot obtain number of capturing groups: "
"%s", pattern, subject, err);
vre2_fini(&vre2);
return 0;
}
assert(ngroups >= 0);
......@@ -720,6 +721,7 @@ vmod_match(VRT_CTX, struct vmod_priv *priv, VCL_STRING pattern,
== NULL) {
VERRNOMEM(ctx, ERR_PREFIX "allocating match data",
pattern, subject);
vre2_fini(&vre2);
return 0;
}
priv->priv = task_match;
......
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