diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 082c61df38a9..3e1d6f67d1e4 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -9073,7 +9073,8 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi, json_object_free(json_paths); json_paths = NULL; first = 0; - } + } else + json_object_free(json_paths); } if (output_cum) {