3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2025-01-03 10:12:48 +01:00

eap-pwd: Don't leak on failure

This commit is contained in:
Denis Kenzior 2018-05-03 12:55:57 -05:00
parent 5cf358cd4f
commit a65e5e0800

View File

@ -761,7 +761,7 @@ static bool eap_pwd_load_settings(struct eap_state *eap,
if (!pwd->identity) {
l_error("EAP-Identity is missing");
return false;
goto error;
}
snprintf(setting, sizeof(setting), "%sPWD-Password", prefix);
@ -770,12 +770,18 @@ static bool eap_pwd_load_settings(struct eap_state *eap,
if (!pwd->password) {
l_error("EAP-PWD password is missing");
return false;
goto error;
}
eap_set_data(eap, pwd);
return true;
error:
l_free(pwd->identity);
l_free(pwd->password);
l_free(pwd);
return false;
}
static struct eap_method eap_pwd = {