summaryrefslogtreecommitdiffstats
path: root/sharpd/sharp_zebra.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2023-11-12 02:31:55 +0100
committerDonald Sharp <sharpd@nvidia.com>2023-11-13 15:16:09 +0100
commitb01738f4d36820f811b680951a6c81f28365558d (patch)
tree2c669ddc7e0cc789b5296dee00d93a9c23d0149f /sharpd/sharp_zebra.c
parentpbrd: Cleanup zclient on shutdown (diff)
downloadfrr-b01738f4d36820f811b680951a6c81f28365558d.tar.xz
frr-b01738f4d36820f811b680951a6c81f28365558d.zip
sharpd: Clean up memory leaks on shutdown
a) The cleanup of zclient on shutdown was not being done b) Cleanup vrf shutdown c) Cleanup some lists Signed-off-by: Donald Sharp <sharpd@nvidia.com> sharpd: Cleanup shutdown of vrf and some lists Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'sharpd/sharp_zebra.c')
-rw-r--r--sharpd/sharp_zebra.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c
index 30bf4f30e..fde9f9f54 100644
--- a/sharpd/sharp_zebra.c
+++ b/sharpd/sharp_zebra.c
@@ -1089,3 +1089,17 @@ void sharp_zebra_init(void)
zclient->zebra_connected = zebra_connected;
zclient->zebra_buffer_write_ready = sharp_zclient_buffer_ready;
}
+
+void sharp_zebra_terminate(void)
+{
+ struct sharp_zclient *node = sharp_clients_head;
+
+ while (node) {
+ sharp_zclient_delete(node->client->session_id);
+
+ node = sharp_clients_head;
+ }
+
+ zclient_stop(zclient);
+ zclient_free(zclient);
+}