aboutsummaryrefslogtreecommitdiffstats
path: root/src/radius/radius_server.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/radius/radius_server.c')
-rw-r--r--src/radius/radius_server.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/radius/radius_server.c b/src/radius/radius_server.c
index b315277..85a485e 100644
--- a/src/radius/radius_server.c
+++ b/src/radius/radius_server.c
@@ -1820,15 +1820,31 @@ radius_server_init(struct radius_server_conf *conf)
/**
- * radius_server_deinit - Deinitialize RADIUS server
+ * radius_server_erp_flush - Flush all ERP keys
* @data: RADIUS server context from radius_server_init()
*/
-void radius_server_deinit(struct radius_server_data *data)
+void radius_server_erp_flush(struct radius_server_data *data)
{
struct eap_server_erp_key *erp;
if (data == NULL)
return;
+ while ((erp = dl_list_first(&data->erp_keys, struct eap_server_erp_key,
+ list)) != NULL) {
+ dl_list_del(&erp->list);
+ bin_clear_free(erp, sizeof(*erp));
+ }
+}
+
+
+/**
+ * radius_server_deinit - Deinitialize RADIUS server
+ * @data: RADIUS server context from radius_server_init()
+ */
+void radius_server_deinit(struct radius_server_data *data)
+{
+ if (data == NULL)
+ return;
if (data->auth_sock >= 0) {
eloop_unregister_read_sock(data->auth_sock);
@@ -1856,11 +1872,7 @@ void radius_server_deinit(struct radius_server_data *data)
sqlite3_close(data->db);
#endif /* CONFIG_SQLITE */
- while ((erp = dl_list_first(&data->erp_keys, struct eap_server_erp_key,
- list)) != NULL) {
- dl_list_del(&erp->list);
- bin_clear_free(erp, sizeof(*erp));
- }
+ radius_server_erp_flush(data);
os_free(data);
}