From: Alan T. DeKok Date: Tue, 19 Feb 2013 22:17:36 +0000 (-0500) Subject: Associate client lists with a parent section. X-Git-Tag: release_3_0_0_beta1~1000 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7aa8eacb9b07e4d1011643beadb233d05691abd2;p=thirdparty%2Ffreeradius-server.git Associate client lists with a parent section. We now have no talloc leaks on exit. We still have a few listeners leaked on exit, but that's mostly because they haven't yet been converted to talloc --- diff --git a/src/include/radiusd.h b/src/include/radiusd.h index 13e43e9f2b7..8dd735a113a 100644 --- a/src/include/radiusd.h +++ b/src/include/radiusd.h @@ -588,7 +588,7 @@ int rad_pps(int *past, int *present, time_t *then, struct timeval *now); /* client.c */ -RADCLIENT_LIST *clients_init(void); +RADCLIENT_LIST *clients_init(CONF_SECTION *cs); void clients_free(RADCLIENT_LIST *clients); RADCLIENT_LIST *clients_parse_section(CONF_SECTION *section); void client_free(RADCLIENT *client); diff --git a/src/main/client.c b/src/main/client.c index e34941e9bec..4636a279109 100644 --- a/src/main/client.c +++ b/src/main/client.c @@ -170,9 +170,9 @@ void clients_free(RADCLIENT_LIST *clients) /* * Return a new, initialized, set of clients. */ -RADCLIENT_LIST *clients_init(void) +RADCLIENT_LIST *clients_init(CONF_SECTION *cs) { - RADCLIENT_LIST *clients = talloc_zero(NULL, RADCLIENT_LIST); + RADCLIENT_LIST *clients = talloc_zero(cs, RADCLIENT_LIST); if (!clients) return NULL; @@ -275,7 +275,7 @@ int client_add(RADCLIENT_LIST *clients, RADCLIENT *client) * Initialize it, if not done already. */ if (!root_clients) { - root_clients = clients_init(); + root_clients = clients_init(NULL); if (!root_clients) return 0; } clients = root_clients; @@ -828,7 +828,7 @@ RADCLIENT_LIST *clients_parse_section(CONF_SECTION *section) clients = cf_data_find(section, "clients"); if (clients) return clients; - clients = clients_init(); + clients = clients_init(section); if (!clients) return NULL; if (cf_top_section(section) == section) global = TRUE;