[master] 5cbb35866 assert magic of vrt_privs when finalizing

Nils Goroll nils.goroll at uplex.de
Fri Nov 27 14:30:09 UTC 2020


commit 5cbb3586649839b83438bd99f557cf30c9c78a66
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Fri Nov 27 15:27:31 2020 +0100

    assert magic of vrt_privs when finalizing

diff --git a/bin/varnishd/cache/cache_vrt_priv.c b/bin/varnishd/cache/cache_vrt_priv.c
index 44692af56..3d2ec57ee 100644
--- a/bin/varnishd/cache/cache_vrt_priv.c
+++ b/bin/varnishd/cache/cache_vrt_priv.c
@@ -225,7 +225,9 @@ VCL_TaskLeave(struct vrt_privs *privs)
 	 * a costly operation. Instead we safely walk the whole tree and clear
 	 * the head at the very end.
 	 */
-	VRBT_FOREACH_SAFE(vp, vrt_privs, privs, vp1)
+	VRBT_FOREACH_SAFE(vp, vrt_privs, privs, vp1) {
+		CHECK_OBJ(vp, VRT_PRIV_MAGIC);
 		VRT_priv_fini(vp->priv);
+	}
 	ZERO_OBJ(privs, sizeof *privs);
 }


More information about the varnish-commit mailing list