diff options
| author | David Lamparter <equinox@diac24.net> | 2018-12-18 18:01:48 +0100 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-18 18:01:48 +0100 | 
| commit | 5704786344507faff48342c7a877bd8dcc9b968f (patch) | |
| tree | 0f5d5c20f9df469e6a3da864d4ab191f7fcd2cb1 /bgpd | |
| parent | 01b4cb3ed6181d7200f66e0187b1e5c5db6c0e5a (diff) | |
| parent | 01cbfd0484796ef9285639efc5b044b2827f0338 (diff) | |
Merge pull request #3503 from qlyoung/fix-bgpd-show-ip-neigh-json-double-free
bgpd: fix json double free when showing neighbors
Diffstat (limited to 'bgpd')
| -rw-r--r-- | bgpd/bgp_vty.c | 5 | 
1 files changed, 3 insertions, 2 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index bac46f251b..2a4421aa54 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -10918,7 +10918,6 @@ static int bgp_show_neighbor(struct vty *vty, struct bgp *bgp,  	if (use_json) {  		vty_out(vty, "%s\n", json_object_to_json_string_ext(  					     json, JSON_C_TO_STRING_PRETTY)); -		json_object_free(json);  	} else {  		vty_out(vty, "\n");  	} @@ -10993,8 +10992,10 @@ static void bgp_show_all_instances_neighbors_vty(struct vty *vty,  		}  	} -	if (use_json) +	if (use_json) {  		vty_out(vty, "}\n"); +		json_object_free(json); +	}  	else if (!nbr_output)  		vty_out(vty, "%% BGP instance not found\n");  }  | 
