ospfd: Ensure show ip ospf interface json code is guarded

When not using json, do not allocate json memory.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2023-07-03 12:55:48 -04:00
parent 806b0ca085
commit 59402d840e

View File

@ -3690,7 +3690,8 @@ static void show_ip_ospf_interface_sub(struct vty *vty, struct ospf *ospf,
"Use all fields following ospfEnabled from interfaceIp hierarchy")
#endif
json_oi = json_object_new_object();
if (use_json)
json_oi = json_object_new_object();
if (CHECK_FLAG(oi->connected->flags, ZEBRA_IFA_UNNUMBERED)) {
if (use_json) {