]> git.puffer.fish Git - mirror/frr.git/commitdiff
pathd: Cleanup shutdown memory leaks 16557/head
authorDonald Sharp <sharpd@nvidia.com>
Mon, 12 Aug 2024 14:14:31 +0000 (10:14 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Mon, 12 Aug 2024 14:14:31 +0000 (10:14 -0400)
Just some code to cleanup the shutdown memory leaks
that are in pathd.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
pathd/pathd.c

index 6c13503c7dccd0c1a38dc5375cd6bb150d0d9c3f..9bb7dbae84a4ed6de949718855b09efbd93a8d0c 100644 (file)
@@ -148,6 +148,16 @@ void srte_segment_list_del(struct srte_segment_list *segment_list)
        XFREE(MTYPE_PATH_SEGMENT_LIST, segment_list);
 }
 
+static void srte_segment_list_terminate(void)
+{
+       while (!RB_EMPTY(srte_segment_list_head, &srte_segment_lists)) {
+               struct srte_segment_list *sl = RB_ROOT(srte_segment_list_head,
+                                                      &srte_segment_lists);
+
+               srte_segment_list_del(sl);
+       }
+}
+
 /**
  * Search for a segment list by name.
  *
@@ -1281,6 +1291,11 @@ void pathd_shutdown(void)
 {
        path_ted_teardown();
        srte_clean_zebra();
+
+       srte_segment_list_terminate();
+
+       vrf_terminate();
+
        frr_fini();
 }