aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-12-28 10:12:14 (GMT)
committerJouni Malinen <j@w1.fi>2016-12-28 12:47:00 (GMT)
commit78022c8366085b75d0b01dce29814a972de6a218 (patch)
tree7defb4109636d3a4bff0485e2292b09941c8c12c /hostapd
parent44785ff27b86d9f323a873a18233efc775f0c3e9 (diff)
downloadhostap-78022c8366085b75d0b01dce29814a972de6a218.zip
hostap-78022c8366085b75d0b01dce29814a972de6a218.tar.gz
hostap-78022c8366085b75d0b01dce29814a972de6a218.tar.bz2
Fix memory leak on hostapd eap_user_file parsing error paths
Need to free all the pending completed EAP users if a parsing error prevents the file from being used. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/config_file.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index ed1478c..e1f9f64 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -517,15 +517,10 @@ static int hostapd_config_read_eap_user(const char *fname,
fclose(f);
if (ret == 0) {
- user = conf->eap_user;
- while (user) {
- struct hostapd_eap_user *prev;
-
- prev = user;
- user = user->next;
- hostapd_config_free_eap_user(prev);
- }
+ hostapd_config_free_eap_users(conf->eap_user);
conf->eap_user = new_user;
+ } else {
+ hostapd_config_free_eap_users(new_user);
}
return ret;