[master] 0a6bf60d3 vev: Tear down the list of events

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Apr 15 17:11:06 UTC 2021


commit 0a6bf60d39c514263c91839db5beb283ec008443
Author: Dridi Boukelmoune <dridi.boukelmoune at 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);
 }
 


More information about the varnish-commit mailing list