Cleanup edges stored in edge_weight_tree on exit
protocol_edge.c: 131 defines local_address using str2sockaddr str2sockaddr() allocates memory which has to be freed on exit.
This commit is contained in:
parent
1140ca6d30
commit
92df36a610
1 changed files with 6 additions and 0 deletions
|
@ -64,6 +64,12 @@ void free_edge_tree(splay_tree_t *edge_tree) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void exit_edges(void) {
|
void exit_edges(void) {
|
||||||
|
// since edge_weight_tree does not have delete action defined
|
||||||
|
// we have to cleanup it on exit
|
||||||
|
for splay_each(edge_t, e, edge_weight_tree) {
|
||||||
|
sockaddrfree(&e->address);
|
||||||
|
sockaddrfree(&e->local_address);
|
||||||
|
}
|
||||||
splay_delete_tree(edge_weight_tree);
|
splay_delete_tree(edge_weight_tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue