Merge pull request #2890 from patrasar/Fix_2847

bgpd: Fix memory leak show ip bgp json
This commit is contained in:
Donald Sharp 2018-08-22 12:26:28 -04:00 committed by GitHub
commit ff7f6cd829
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8202,7 +8202,6 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
vty_out(vty, " \"routeDistinguishers\" : {"); vty_out(vty, " \"routeDistinguishers\" : {");
++*json_header_depth; ++*json_header_depth;
} }
json_paths = json_object_new_object();
} }
if (use_json && rd) { if (use_json && rd) {
@ -8429,8 +8428,6 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
*total_cum = total_count; *total_cum = total_count;
} }
if (use_json) { if (use_json) {
if (json_paths)
json_object_free(json_paths);
if (rd) { if (rd) {
vty_out(vty, " }%s ", (is_last ? "" : ",")); vty_out(vty, " }%s ", (is_last ? "" : ","));
} }