[master] c46b48506 Plug minor leak

Federico G. Schwindt fgsch at lodoss.net
Sun Jan 5 19:59:07 UTC 2020


commit c46b48506f19e0d4e9bb14662c455621887dae66
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Sun Jan 5 19:57:38 2020 +0000

    Plug minor leak

diff --git a/bin/varnishtest/vtc_process.c b/bin/varnishtest/vtc_process.c
index 92a591786..39911afaa 100644
--- a/bin/varnishtest/vtc_process.c
+++ b/bin/varnishtest/vtc_process.c
@@ -513,6 +513,13 @@ process_stderr(const struct vev *ev, int what)
 	return (0);
 }
 
+static void
+process_cleanup(void *priv)
+{
+	struct vev_root *evb = priv;
+	VEV_Destroy(&evb);
+}
+
 static void *
 process_thread(void *priv)
 {
@@ -530,6 +537,7 @@ process_thread(void *priv)
 
 	evb = VEV_New();
 	AN(evb);
+	pthread_cleanup_push(process_cleanup, evb);
 
 	ev = VEV_Alloc();
 	AN(ev);
@@ -575,6 +583,7 @@ process_thread(void *priv)
 
 	AZ(pthread_mutex_unlock(&p->mtx));
 
+	pthread_cleanup_pop(0);
 	VEV_Destroy(&evb);
 	if (p->log == 1) {
 		VLU_Destroy(&p->vlu_stdout);


More information about the varnish-commit mailing list