]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospf6d: Don't allocate json memory in non-json path
authorDonald Sharp <sharpd@nvidia.com>
Fri, 9 Dec 2022 13:32:12 +0000 (08:32 -0500)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Sat, 10 Dec 2022 02:20:12 +0000 (02:20 +0000)
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 21c6569d6f4dca71b4ddf7e6499e296efaf819c0)

ospf6d/ospf6_interface.c

index 155374d3f0b35f224d4ef84dc6e98c6976d823bd..433e8a3576a2f31b9377c47560b29e45226c9345 100644 (file)
@@ -1234,7 +1234,8 @@ static int ospf6_interface_show(struct vty *vty, struct interface *ifp,
                }
        }
 
-       json_auth = json_object_new_object();
+       if (use_json)
+               json_auth = json_object_new_object();
        if (oi->at_data.flags != 0) {
                if (use_json) {
                        if (CHECK_FLAG(oi->at_data.flags,