Skip to content

Commit

Permalink
Merge pull request FRRouting#13436 from donaldsharp/ospf_json_mem_leak
Browse files Browse the repository at this point in the history
ospfd: Fix memory leaks w/ `show ip ospf int X json` commands
  • Loading branch information
ton31337 committed May 5, 2023
2 parents d6d4962 + 74e2173 commit 4ead655
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ospfd/ospf_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -3996,16 +3996,15 @@ static int show_ip_ospf_interface_common(struct vty *vty, struct ospf *ospf,
/* Interface name is specified. */
ifp = if_lookup_by_name(intf_name, ospf->vrf_id);
if (ifp == NULL) {
if (use_json)
if (use_json) {
json_object_boolean_true_add(json_vrf,
"noSuchIface");
else
json_object_free(json_interface);
} else
vty_out(vty, "No such interface name\n");
} else {
if (use_json) {
if (use_json)
json_interface_sub = json_object_new_object();
json_interface = json_object_new_object();
}

show_ip_ospf_interface_sub(
vty, ospf, ifp, json_interface_sub, use_json);
Expand Down

0 comments on commit 4ead655

Please sign in to comment.