EAP server: Simplify EAP method registration call
Free the allocated structure in error cases to remove need for each EAP method to handle the error cases separately. Each registration function can simply do "return eap_server_method_register(eap);" in the end of the function. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
49a26bb3e3
commit
814f43cff5
22 changed files with 33 additions and 122 deletions
|
@ -571,7 +571,6 @@ static Boolean eap_mschapv2_isSuccess(struct eap_sm *sm, void *priv)
|
|||
int eap_server_mschapv2_register(void)
|
||||
{
|
||||
struct eap_method *eap;
|
||||
int ret;
|
||||
|
||||
eap = eap_server_method_alloc(EAP_SERVER_METHOD_INTERFACE_VERSION,
|
||||
EAP_VENDOR_IETF, EAP_TYPE_MSCHAPV2,
|
||||
|
@ -588,8 +587,5 @@ int eap_server_mschapv2_register(void)
|
|||
eap->getKey = eap_mschapv2_getKey;
|
||||
eap->isSuccess = eap_mschapv2_isSuccess;
|
||||
|
||||
ret = eap_server_method_register(eap);
|
||||
if (ret)
|
||||
eap_server_method_free(eap);
|
||||
return ret;
|
||||
return eap_server_method_register(eap);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue