[master] 42b8179fd Rearrange to avoid a tiny leak

Federico G. Schwindt fgsch at lodoss.net
Tue Oct 9 13:10:15 UTC 2018


commit 42b8179fd1bf44439094d7c09a2578baa13be1a0
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Tue Oct 9 14:07:50 2018 +0100

    Rearrange to avoid a tiny leak

diff --git a/bin/varnishd/mgt/mgt_param.c b/bin/varnishd/mgt/mgt_param.c
index f3faa9cb3..9c6a74685 100644
--- a/bin/varnishd/mgt/mgt_param.c
+++ b/bin/varnishd/mgt/mgt_param.c
@@ -353,8 +353,6 @@ mcf_param_show_json(struct cli *cli, const char * const *av, void *priv)
 	struct vsb *vsb, *def;
 	const char *show = NULL;
 
-	vsb = VSB_new_auto();
-	def = VSB_new_auto();
 	(void)priv;
 
 	for (int i = 2; av[i] != NULL; i++) {
@@ -372,6 +370,9 @@ mcf_param_show_json(struct cli *cli, const char * const *av, void *priv)
 		show = av[i];
 	}
 
+	vsb = VSB_new_auto();
+	def = VSB_new_auto();
+
 	n = 0;
 	VCLI_JSON_begin(cli, 2, av);
 	VCLI_Out(cli, ",\n");


More information about the varnish-commit mailing list