diff options
| author | David Lamparter <equinox@diac24.net> | 2018-12-18 18:02:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-18 18:02:10 +0100 |
| commit | 1e8dc574c72d6b210f463a37f12da133c8c674db (patch) | |
| tree | b405277370444aa47ad40e3cb9904a271fd4ff74 | |
| parent | b85ed2f2288822f620c4acaa5368d1aca6b73c62 (diff) | |
| parent | f26dca2b55092e53d2e46072dc4d402d8c7474a2 (diff) | |
Merge pull request #3504 from qlyoung/fix-bgpd-show-ip-neigh-json-double-free-6.0
bgpd: fix json double free when showing neighbors [6.0]
| -rw-r--r-- | bgpd/bgp_vty.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 8d3a485d5b..e54a873e15 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -10730,7 +10730,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"); } @@ -10803,8 +10802,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); + } } static int bgp_show_neighbor_vty(struct vty *vty, const char *name, |
