1
0
forked from aniani/gmnisrv

config: free more routing information on finish

This commit is contained in:
Drew DeVault 2020-10-28 12:43:05 -04:00
parent becc4460b6
commit 077b96d3cc

View File

@ -286,6 +286,7 @@ config_finish(struct gmnisrv_config *conf)
free(bind); free(bind);
bind = next; bind = next;
} }
struct gmnisrv_host *host = conf->hosts; struct gmnisrv_host *host = conf->hosts;
while (host) { while (host) {
struct gmnisrv_host *next = host->next; struct gmnisrv_host *next = host->next;
@ -293,12 +294,22 @@ config_finish(struct gmnisrv_config *conf)
struct gmnisrv_route *route = host->routes; struct gmnisrv_route *route = host->routes;
while (route) { while (route) {
switch (route->routing) {
case ROUTE_PATH:
free(route->path);
break;
case ROUTE_REGEX:
assert(0); // TODO
}
struct gmnisrv_route *rnext = route->next; struct gmnisrv_route *rnext = route->next;
free(route->spec);
free(route->root); free(route->root);
free(route->index); free(route->index);
free(route); free(route);
route = rnext; route = rnext;
} }
free(host); free(host);
host = next; host = next;
} }