[master] d76e051 Plug a harmless resource leak to silence Coverity

Poul-Henning Kamp phk at FreeBSD.org
Mon Feb 13 12:21:06 CET 2017


commit d76e051c3f67f897f17175f6ef6eac25a87db6eb
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Feb 13 11:19:53 2017 +0000

    Plug a harmless resource leak to silence Coverity

diff --git a/bin/varnishtest/vtc_varnish.c b/bin/varnishtest/vtc_varnish.c
index ec63d1d..76a78d4 100644
--- a/bin/varnishtest/vtc_varnish.c
+++ b/bin/varnishtest/vtc_varnish.c
@@ -696,8 +696,11 @@ varnish_cli(struct varnish *v, const char *cli, unsigned exp, const char *re)
 	}
 	if (v->cli_fd < 0)
 		varnish_launch(v);
-	if (vtc_error)
+	if (vtc_error) {
+		if (vre != NULL)
+			VRE_free(&vre);
 		return;
+	}
 	u = varnish_ask_cli(v, cli, &resp);
 	vtc_log(v->vl, 2, "CLI %03u <%s>", u, cli);
 	if (exp != 0 && exp != (unsigned)u)



More information about the varnish-commit mailing list