From 0cad6e2653d8b00e8c073765756224fa7bb62e59 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 30 Nov 2016 08:23:11 -0500 Subject: [PATCH] ospfd: Fix memory leak when not using json When doing a show command under ospf, if not using json we would have a small memory leak in show_ip_ospf_common. Signed-off-by: Donald Sharp (cherry picked from commit 50750712b1ac8364e290c67782eaf371025dc59e) Signed-off-by: David Lamparter --- ospfd/ospf_vty.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index b0946600ba..43a443421f 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -3299,8 +3299,10 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) json_object *json_areas = NULL; if (use_json) - json = json_object_new_object(); - json_areas = json_object_new_object(); + { + json = json_object_new_object(); + json_areas = json_object_new_object(); + } if (ospf->instance) { -- 2.39.5