summaryrefslogtreecommitdiff
path: root/zebra/zebra_gr.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2024-03-12 21:15:29 -0400
committerDonald Sharp <sharpd@nvidia.com>2024-03-12 21:18:02 -0400
commit9ef76cff98de97d633961041d5ca9a3844f1ebbb (patch)
treebdc0e75db124c575ab31b596ddf4393c4e6c90b3 /zebra/zebra_gr.c
parentdfa27764a2c2d3d1b08bbba9cd9864c23c35574d (diff)
zebra: Cleanup leaked memory on shutdown from GR code
Recent commit: 6b2554b94a Exposed, via Address Sanitation, that memory was being leaked. Unfortunately the CI system did not catch this. Two pieces of memory were being lost: The zserv client data structure as well as anything on the client->gr_info_queue. Clean these up. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/zebra_gr.c')
-rw-r--r--zebra/zebra_gr.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/zebra/zebra_gr.c b/zebra/zebra_gr.c
index f4241f1d72..cee66cc055 100644
--- a/zebra/zebra_gr.c
+++ b/zebra/zebra_gr.c
@@ -298,6 +298,16 @@ struct zebra_gr_afi_clean {
* Functions to deal with capabilities
*/
+void zebra_gr_client_final_shutdown(struct zserv *client)
+{
+ struct client_gr_info *info;
+
+ while (!TAILQ_EMPTY(&client->gr_info_queue)) {
+ info = TAILQ_FIRST(&client->gr_info_queue);
+ zebra_gr_client_info_delete(client, info);
+ }
+}
+
/*
* Function to decode and call appropriate functions
* to handle client capabilities.