[cmaster-next] [PATCH 1/2] ospfd: Fix memory leak when not using json

Donald Sharp sharpd at cumulusnetworks.com
Wed Nov 30 08:23:11 EST 2016


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 at cumulusnetworks.com>
(cherry picked from commit 50750712b1ac8364e290c67782eaf371025dc59e)
---
 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 b094660..43a4434 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.5.5





More information about the dev mailing list