ospfd: check for NULLs in vty code

There were a couple of cli paths that NULL-checked in the
vtysh output path, but not in the json path.

Signed-off-by: Mark Stapp <mjs@labn.net>
(cherry picked from commit 864a3bc185)
This commit is contained in:
Mark Stapp 2023-06-30 09:44:00 -04:00 committed by Mergify
parent 26e22ff7e5
commit 93a3c738c8
2 changed files with 9 additions and 0 deletions

View File

@ -651,6 +651,9 @@ static int show_ip_ospf_mpls_ldp_interface_common(struct vty *vty,
rn = route_next(rn)) {
oi = rn->info;
if (oi == NULL)
continue;
if (use_json) {
json_interface_sub =
json_object_new_object();
@ -686,6 +689,9 @@ static int show_ip_ospf_mpls_ldp_interface_common(struct vty *vty,
rn = route_next(rn)) {
oi = rn->info;
if (oi == NULL)
continue;
if (use_json)
json_interface_sub =
json_object_new_object();

View File

@ -4094,6 +4094,9 @@ static int show_ip_ospf_interface_traffic_common(
rn = route_next(rn)) {
oi = rn->info;
if (oi == NULL)
continue;
if (use_json) {
json_interface_sub =
json_object_new_object();