mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-14 14:46:57 +00:00
bgpd: Free up non-freed json memory on function return
json_peers is allocated in the above if statement block for json but is not freed in this code path. Noticed by running Address Sanitizer. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
c4fdc837c0
commit
ce4e451c5b
@ -12046,6 +12046,8 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
|
||||
|
||||
if (show_failed && !failed_count) {
|
||||
if (use_json) {
|
||||
json_object_free(json_peers);
|
||||
|
||||
json_object_int_add(json, "failedPeersCount", 0);
|
||||
json_object_int_add(json, "dynamicPeers", dn_count);
|
||||
json_object_int_add(json, "totalPeers", count);
|
||||
|
Loading…
Reference in New Issue
Block a user