[master] 4706fc1b9 param: Plug leak spotted by lsan, take 2

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Tue Dec 14 16:20:07 UTC 2021


commit 4706fc1b9406c4ae1425b82c636863b8db89b218
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Dec 14 17:18:07 2021 +0100

    param: Plug leak spotted by lsan, take 2

diff --git a/bin/varnishd/mgt/mgt_param.c b/bin/varnishd/mgt/mgt_param.c
index 4070ddb42..7cfebcc20 100644
--- a/bin/varnishd/mgt/mgt_param.c
+++ b/bin/varnishd/mgt/mgt_param.c
@@ -248,8 +248,6 @@ mcf_param_show(struct cli *cli, const char * const *av, void *priv)
 	struct vsb *vsb;
 	const char *show = NULL;
 
-	vsb = VSB_new_auto();
-	AN(vsb);
 	(void)priv;
 
 	for (n = 2; av[n] != NULL; n++) {
@@ -270,6 +268,9 @@ mcf_param_show(struct cli *cli, const char * const *av, void *priv)
 		lfmt = 1;
 	}
 
+	vsb = VSB_new_auto();
+	AN(vsb);
+
 	n = 0;
 	VTAILQ_FOREACH(pl, &phead, list) {
 		pp = pl->spec;


More information about the varnish-commit mailing list