Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bgpd:[GR] fix crash in print_bgp_vrfs json
When BGP is in warm boot and `show bgp vrfs json` is executed more than once, bgpd crashes in print_bgp_vrfs. This is happening because of JSON object is being added multiple times to the JSON array with out allocating everytime in the for loop and when json is freed, it causes the crash. NOTE: This commit needs to be integrated with original commit 4af3b55 Ticket: #3861755 Testing: Before the fix: switch# show bgp vrfs json Warning: connecting to bgpd...success! { .. <snippet> } switch# show bgp vrfs json Warning: closing connection to bgpd because of an I/O error! Warning: connecting to bgpd...failed! After the fix: BGP no longer crashes on `show bgp vrfs json` command and it works as expected. switch# show bgp vrfs json { "vrfs":{ .. <snippet> } switch# show bgp vrfs json { "vrfs":{ .. <snippet> } switch# show bgp vrfs json { "vrfs":{ .. <snippet> } switch# show bgp vrfs json { "vrfs":{ .. <snippet> } Signed-off-by: Karthikeya Venkat Muppalla <[email protected]> Signed-off-by: Pooja Jagadeesh Doijode <[email protected]>
- Loading branch information