From: Donald Sharp Date: Fri, 9 Dec 2022 13:32:12 +0000 (-0500) Subject: ospf6d: Don't allocate json memory in non-json path X-Git-Tag: docker/8.4.2~12^2~2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=c348fec83b0d834f5993ab5b375432b8d398f3b9;p=matthieu%2Ffrr.git ospf6d: Don't allocate json memory in non-json path Signed-off-by: Donald Sharp (cherry picked from commit 21c6569d6f4dca71b4ddf7e6499e296efaf819c0) --- diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index 155374d3f0..433e8a3576 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -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,