From 3e78a6ce5b55302b07652eb15572d80a2799e026 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Wed, 26 Aug 2020 08:46:28 +0300 Subject: [PATCH] bgpd: Remove a deadcode freeing JSON in bgp_show_all_instances_neighbors_vty json = NULL; is set in a loop above and here we are trying to check and free the object again which is never be reached. Signed-off-by: Donatas Abraitis --- bgpd/bgp_vty.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 1c7727dd0b..dfa812357f 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -12800,11 +12800,8 @@ static void bgp_show_all_instances_neighbors_vty(struct vty *vty, json = NULL; } - if (use_json) { + if (use_json) vty_out(vty, "}\n"); - if (json) - json_object_free(json); - } else if (!nbr_output) vty_out(vty, "%% BGP instance not found\n"); }