Commit f25da8ef authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

vmod_debug: Plug minor ACL leak

Spotted by lsan.
parent 26e92d15
...@@ -221,6 +221,7 @@ xyzzy_time_acl(VRT_CTX, VCL_ACL acl, VCL_IP ip0, VCL_IP ip1, ...@@ -221,6 +221,7 @@ xyzzy_time_acl(VRT_CTX, VCL_ACL acl, VCL_IP ip0, VCL_IP ip1,
{ {
struct acl_sweep asw[1]; struct acl_sweep asw[1];
vtim_mono t0, t1; vtim_mono t0, t1;
vtim_dur d;
VCL_INT cnt; VCL_INT cnt;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
...@@ -244,9 +245,12 @@ xyzzy_time_acl(VRT_CTX, VCL_ACL acl, VCL_IP ip0, VCL_IP ip1, ...@@ -244,9 +245,12 @@ xyzzy_time_acl(VRT_CTX, VCL_ACL acl, VCL_IP ip0, VCL_IP ip1,
} while (step_sweep(asw) <= 0); } while (step_sweep(asw) <= 0);
} }
t1 = VTIM_mono(); t1 = VTIM_mono();
cnt = asw->count;
assert(cnt > 0);
d = (t1 - t0) / cnt;
VSLb(ctx->vsl, SLT_Debug, VSLb(ctx->vsl, SLT_Debug,
"Timed ACL: %.9f -> %.9f = %.9f %.9f/round, %.9f/IP %ju IPs", "Timed ACL: %.9f -> %.9f = %.9f %.9f/round, %.9f/IP %ju IPs",
t0, t1, t1 - t0, (t1-t0) / turnus, (t1-t0) / asw->count, t0, t1, t1 - t0, (t1-t0) / turnus, d, (intmax_t)cnt);
(uintmax_t)asw->count); cleanup_sweep(asw);
return ((t1 - t0) / asw->count); return (d);
} }
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