diff options
author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2022-01-31 14:56:56 +0100 |
---|---|---|
committer | Donatas Abraitis <donatas.abraitis@gmail.com> | 2022-01-31 15:53:23 +0100 |
commit | 8b3f1d41fe9e534b51dd564db0d3d28812b77563 (patch) | |
tree | a2130104a3e574055b85af991a4694d361e442f8 /ospf6d/ospf6_zebra.c | |
parent | Merge pull request #9869 from leonshaw/fix/evpn-queue (diff) | |
download | frr-8b3f1d41fe9e534b51dd564db0d3d28812b77563.tar.xz frr-8b3f1d41fe9e534b51dd564db0d3d28812b77563.zip |
ospf6d: Fix memory leak for `show ipv6 ospf6 zebra json`
$ for x in $(seq 1 10000); do vtysh -c 'show ipv6 ospf6 zebra json' >/dev/null; done
Before:
```
$ vtysh -c 'show memory ospf6d' | grep 'Total heap allocated'
Total heap allocated: 26 MiB
```
After:
```
$ vtysh -c 'show memory ospf6d' | grep 'Total heap allocated'
Total heap allocated: 2256 KiB
```
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'ospf6d/ospf6_zebra.c')
-rw-r--r-- | ospf6d/ospf6_zebra.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index b81863351..82d280811 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -352,9 +352,7 @@ DEFUN(show_zebra, json_object_object_add(json_zebra, "redistribute", json_array); json_object_object_add(json, "zebraInformation", json_zebra); - vty_out(vty, "%s\n", - json_object_to_json_string_ext( - json, JSON_C_TO_STRING_PRETTY)); + vty_json(vty, json); } else { vty_out(vty, "Zebra Infomation\n"); vty_out(vty, " fail: %d\n", zclient->fail); |