Skip to content

Commit

Permalink
Merge pull request #16557 from donaldsharp/pathd_shutdown_memory_leaks
Browse files Browse the repository at this point in the history
pathd: Cleanup shutdown memory leaks
  • Loading branch information
ton31337 authored Aug 12, 2024
2 parents 7433379 + 33af3c0 commit b4e4fb4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pathd/pathd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -1281,6 +1291,11 @@ void pathd_shutdown(void)
{
path_ted_teardown();
srte_clean_zebra();

srte_segment_list_terminate();

vrf_terminate();

frr_fini();
}

Expand Down

0 comments on commit b4e4fb4

Please sign in to comment.