]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_vty.c
staticd: Do not ready prefix for printing till it's decoded
[mirror_frr.git] / bgpd / bgp_vty.c
index bac46f251b0812f118e0e4e714b919bdc5763831..2a4421aa54d30089d77699025c5100ec70f8075e 100644 (file)
@@ -10918,7 +10918,6 @@ static int bgp_show_neighbor(struct vty *vty, struct bgp *bgp,
        if (use_json) {
                vty_out(vty, "%s\n", json_object_to_json_string_ext(
                                             json, JSON_C_TO_STRING_PRETTY));
-               json_object_free(json);
        } else {
                vty_out(vty, "\n");
        }
@@ -10993,8 +10992,10 @@ static void bgp_show_all_instances_neighbors_vty(struct vty *vty,
                }
        }
 
-       if (use_json)
+       if (use_json) {
                vty_out(vty, "}\n");
+               json_object_free(json);
+       }
        else if (!nbr_output)
                vty_out(vty, "%% BGP instance not found\n");
 }