Mailing List Archive

[master] 0a6bf60d3 vev: Tear down the list of events
commit 0a6bf60d39c514263c91839db5beb283ec008443
Author: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
Date: Thu Apr 15 18:50:21 2021 +0200

vev: Tear down the list of events

It was either this or adding a suppression for lsan.

diff --git a/lib/libvarnish/vev.c b/lib/libvarnish/vev.c
index f83832c6f..ab3544899 100644
--- a/lib/libvarnish/vev.c
+++ b/lib/libvarnish/vev.c
@@ -219,12 +219,17 @@ void
VEV_Destroy(struct vev_root **evbp)
{
struct vev_root *evb;
+ struct vev *e;

TAKE_OBJ_NOTNULL(evb, evbp, VEV_BASE_MAGIC);
assert(pthread_equal(evb->thread, pthread_self()));
+ while ((e = VBH_root(evb->binheap)) != NULL) {
+ VEV_Stop(evb, e);
+ free(e);
+ }
+ VBH_destroy(&evb->binheap);
free(evb->pfd);
free(evb->pev);
- /* XXX: destroy evb->binheap */
FREE_OBJ(evb);
}

_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit