]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: Fix memory leak when not using json
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 30 Nov 2016 13:23:11 +0000 (08:23 -0500)
committerDavid Lamparter <equinox@opensourcerouting.org>
Thu, 1 Dec 2016 15:28:12 +0000 (16:28 +0100)
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 <sharpd@cumulusnetworks.com>
(cherry picked from commit 50750712b1ac8364e290c67782eaf371025dc59e)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
ospfd/ospf_vty.c

index b0946600bafd8d4dfa7751d76876b036ae3443d0..43a443421f9f811daf89bec4e7ec1d38ff01d7be 100644 (file)
@@ -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)
     {