diff options
author | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-01-23 12:46:42 +0100 |
---|---|---|
committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-01-23 12:46:42 +0100 |
commit | 88c5852b72a9a437fbfb0b349ab793048175efe1 (patch) | |
tree | 37b4ad00b8db881bf18e272ae4f1590dc097daef /ospfd/ospf_vty.c | |
parent | ospfd: Free memory for JSON allocated object before return (diff) | |
download | frr-88c5852b72a9a437fbfb0b349ab793048175efe1.tar.xz frr-88c5852b72a9a437fbfb0b349ab793048175efe1.zip |
ospfd: Free memory for JSON allocated object before return
For show_ip_ospf_database_type_adv_router_common().
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to '')
-rw-r--r-- | ospfd/ospf_vty.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 4799e5bd8..c86f22b6d 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -7314,16 +7314,26 @@ static int show_ip_ospf_database_type_adv_router_common(struct vty *vty, type = OSPF_OPAQUE_AREA_LSA; else if (strncmp(argv[arg_base + idx_type]->text, "opaque-as", 9) == 0) type = OSPF_OPAQUE_AS_LSA; - else + else { + if (uj) { + if (use_vrf) + json_object_free(json_vrf); + } return CMD_WARNING; + } /* `show ip ospf database LSA adv-router ADV_ROUTER'. */ if (strncmp(argv[arg_base + 5]->text, "s", 1) == 0) adv_router = ospf->router_id; else { ret = inet_aton(argv[arg_base + 6]->arg, &adv_router); - if (!ret) + if (!ret) { + if (uj) { + if (use_vrf) + json_object_free(json_vrf); + } return CMD_WARNING; + } } show_lsa_detail_adv_router(vty, ospf, type, &adv_router, json_vrf); |