diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index f1bd4c77d135..22c43a93eb55 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -9371,7 +9371,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) {