Rearrange to avoid a tiny leak

parent 827cd226
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment