Use a shared function for freeing PSK list
There is no need to duplicate this code in multiple locations. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
fc5550a1c2
commit
f2a14be798
4 changed files with 16 additions and 21 deletions
|
@ -55,14 +55,9 @@ struct hostapd_acl_query_data {
|
|||
#ifndef CONFIG_NO_RADIUS
|
||||
static void hostapd_acl_cache_free_entry(struct hostapd_cached_radius_acl *e)
|
||||
{
|
||||
struct hostapd_sta_wpa_psk_short *psk = e->psk;
|
||||
os_free(e->identity);
|
||||
os_free(e->radius_cui);
|
||||
while (psk) {
|
||||
struct hostapd_sta_wpa_psk_short *prev = psk;
|
||||
psk = psk->next;
|
||||
os_free(prev);
|
||||
}
|
||||
hostapd_free_psk_list(e->psk);
|
||||
os_free(e);
|
||||
}
|
||||
|
||||
|
@ -636,3 +631,13 @@ void hostapd_acl_deinit(struct hostapd_data *hapd)
|
|||
hostapd_acl_query_free(prev);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void hostapd_free_psk_list(struct hostapd_sta_wpa_psk_short *psk)
|
||||
{
|
||||
while (psk) {
|
||||
struct hostapd_sta_wpa_psk_short *prev = psk;
|
||||
psk = psk->next;
|
||||
os_free(prev);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue