aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_server/eap_server_mschapv2.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2016-01-13 21:35:53 (GMT)
committerJouni Malinen <j@w1.fi>2016-01-13 21:35:53 (GMT)
commit814f43cff5e366f3a6a6452666629d73c83161a1 (patch)
tree1383c7153508bb6120ec754142a0551022ed0086 /src/eap_server/eap_server_mschapv2.c
parent49a26bb3e37ef7d3c9b8b55a5a331ae64a1cd0f3 (diff)
downloadhostap-814f43cff5e366f3a6a6452666629d73c83161a1.zip
hostap-814f43cff5e366f3a6a6452666629d73c83161a1.tar.gz
hostap-814f43cff5e366f3a6a6452666629d73c83161a1.tar.bz2
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>
Diffstat (limited to 'src/eap_server/eap_server_mschapv2.c')
-rw-r--r--src/eap_server/eap_server_mschapv2.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/eap_server/eap_server_mschapv2.c b/src/eap_server/eap_server_mschapv2.c
index 98d74e0..460cd9c 100644
--- a/src/eap_server/eap_server_mschapv2.c
+++ b/src/eap_server/eap_server_mschapv2.c
@@ -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);
}