Closed PolynomialDivision closed 4 years ago
hna_groups is a list. Actually the finish function should iterate over the list and free ping_hosts and hna_list for every hna_group entry.
hna_groups
ping_hosts
hna_list
hna_group entry
(not tested or compiled)
void olsrd_plugin_fini(void) { while(hna_groups) { while (hna_groups->ping_hosts) { struct ping_list* next = hna_groups->ping_hosts->next; free(hna_groups->ping_hosts->ping_address); free(hna_groups->ping_hosts); hna_groups->ping_hosts = next; } while (hna_groups->hna_list) { struct hna_list * next = hna_groups->hna_list->next; free(hna_groups->hna_list); hna_groups->hna_list = next; } struct hna_group* next = hna_groups->next; free(hna_groups); hna_groups = next; } }
https://github.com/OLSR/olsrd/blob/master/lib/dyn_gw/src/olsrd_dyn_gw.c#L313
hna_groups
is a list. Actually the finish function should iterate over the list and freeping_hosts
andhna_list
for everyhna_group entry
.(not tested or compiled)
https://github.com/OLSR/olsrd/blob/master/lib/dyn_gw/src/olsrd_dyn_gw.c#L313